The structural properties of XeF2 in the pressure range from 0 to 80 GPa are studied by plane-wave pseudopotential density functional theory method. The calculated values are in agreement with the experimental data. Based on the calculated elastic constants of XeF2 under different pressures, the I4/mmm structure of XeF2 is confirmed to be stable in the pressure range from 0 to 80 GPa. The band gap of XeF2 at different pressure is calculated and the band gap is found to decrease with the increase of pressure. When the pressure is greater than 10 GPa the band gap of XeF2 increases linearly with the increase of pressure, which indicates that XeF2 transforms from the insulator to semiconductor and has more and more strong metallic with the increase of pressure.