Determination of atomic relaxations in mixed valence systems from X-ray absorption near edge structures