Question: why are xef2 and xef4 nonpolar?
Answer: Polarity results from the net dipole moment in the molecule. Even though, C-O, Xe-F bond is polar due to differences in electronegativity, but the net dipole moment of CO2, XeF2, XeF4 is zero due to their symmetrical structures. Similarly, four dipoles in a planar structure of XeF4 cancel each other.