We know that, the algebraic sum of the oxidation states is always zero in neutral compound.
Oxidation states of X=+2 Y=+5 Z=−2
So, the algebraic sum of total X,Y and Z should be equal to zero which is found in XY2Z6. XY2Z6=+2+(5×2)+(−2×6) =+2+10−12=0