  The progress in high performance computing we are witnessing today offers the
possibility of accurate electron density calculations of systems in realistic
physico-chemical conditions. In this paper, we present a strategy aimed at
performing a first-principle computation of the low energy part of the X-ray
Absorption Spectroscopy (XAS) spectrum based on the density functional theory
calculation of the electronic potential. To test its effectiveness we apply the
method to the computation of the X-ray Absorption Near Edge Structure part of
the XAS spectrum in the paradigmatic, but simple case of Cu2+ in water. In
order to keep into account the effect of the metal site structure fluctuations
in determining the experimental signal, the theoretical spectrum is evaluated
as the average over the computed spectra of a statistically significant number
of simulated metal site configurations. The comparison of experimental data
with theoretical calculations suggests that Cu2+ lives preferentially in a
square-pyramidal geometry. The remarkable success of this approach in the
interpretation of XAS data makes us optimistic about the possibility of
extending the computational strategy we have outlined to the more interesting
case of molecules of biological relevance bound to transition metal ions.
