Guide to flash the firmware without needing to Unlock the boat loader. Follow this guide to change the region of your phone or if it has a lot of bloatware or foreign language installs.

Step 1: On your PC, install the drivers for your phone. Do this by connecting your Sony XZ via a usb to your PC. It will then ask to install Xperia Companion automatically with included drivers.

Step 2: Download these programs on your PC:

Step 3: Download the firmware from you phone using XperiFirm.

Step 4: Use Flashtool to convert the firmware file into a FTF file. Open Flashtool, select Tools > Bundles > Create. Write your region to Branding and your version to Version.

Step 5: Flashing the Firmware

  • Press Flash Device (the flash icon on the left side), select Flashmode, select your firmware from Firmwares.

  • In Wipe, Sin section (not exclude), select all boxes, DO NOT SELECT SIM-LOCK, then press Flash. Wait for Flashmode screen should appear when the operation finish.

  • Turn off your phone. Press Power and Volume Keys and Connect the Phone via USB Cable AT THE SAME TIME to put the phone to Flashmode. The LED should blink Green and Flashtool will do its work.

  • When it says "flash completed, restart your phone.", restart your phone. Your new firmware is ready to use.

 

 

Ref:

https://forum.xda-developers.com/xperia-xz/how-to/guide-flashing-firmware-xperia-phones-t3860048