The Principles of X-Ray Absorption Spectroscopy