Many-body XAFS theory at zero and finite temperature is proposed based on the two different theories, scattering theory and nonequilibrium (Keldysh) Green's function theory. The latter has an advantage to describe finite temperature XAFS, and the former is flexible to include core-hole effects. In the Keldysh Green's function theory, the X-ray absorption intensity is described in terms of the reducible polarization propagator. By applying the skeleton diagram expansion, we obtain useful approximate formulas. Some important problems in XAFS analyses such as Debye-Waller and Franck-Condon factors, the subtle cancellation of loss structures are discussed by using these theoretical tools, and are closely compared with each other. In particular scattering Green's function including optical potential is compared with G > and G r , and the optical potential is compared with the self-energy in the Keldysh theory, Σ > , Σ r and Σ. Based on the nonequilibrium Green's function formula, we obtain the convolution XAFS...