Sony says you shouldn't use the Xperia XZ1 and XZ1 Compact underwater, despite them being water-resistant16
Here's exactly what Sony states about the water resistance of the Xperia XZ1 in a footnote on its official website (also valid for the Compact):
So, there you go. While the XZ1 and XZ1 Compact could very well survive being underwater for some time, it's probably better not to test that. This is (likely) because IP certifications are given following tests made in controlled laboratory environments - which may differ from, you know, real life.
Mind you, Sony says exactly the same thing about some of its previous water-resistant Xperia phones (including the Xperia XZ Premium): you shouldn't put them completely underwater. Thus, this isn't a recent change of policy, and yet we still thought customers needed to know, because not everyone reads all the footnotes.
In case you're wondering, manufacturers like Samsung and LG do not have cautions like this one when it comes to their water-resistant phones (including the Galaxy Note 8, Galaxy S8, V30, and G6). According to them, it's safe to use the handsets underwater up to 1.5 meters for no more than 30 minutes.
sources: Sony Xperia XZ1, Sony Xperia XZ1 Compact