In accurate analyses of XPD spectra, the atomic potential at each site plays an important role. Hermitian potential like Hartree-Fock potential cannot describe the damping of the photoelectron wave, so that it is crucial to go beyond one-electron theory for the XPD analyses. Our optical potential is energy dependent, non-local and self-consistent based on Hedin's GW approximation. Here we apply this optical potential to the N 1s XPD spectra of N2 adsorbed on metals, and compare the results by use of different approximations.