For proper connection of your Sony Xperia XZ with PC, you need to have right driver installed on the latter. This is required to able to transfer files between the two devices, and also if you are looking install things over fastboot and ADB. Here are Xperia XZ driver that should help you with this.
You need proper driver to be able to do some deep customization too: if youa re looking to root over fastboot, over install TWRP recovery.
Xperia XZ Ultra Driver Download