1) In XeF4
XeF4=0
Xe+4×(−1)=0
Xe=+4
2) In XeO2
XeO2=0
Xe+(−2)×2=0
3) Thus, Oxidation state of Xe in both the compound is +4.