Changes of valence state and local structure in anode materials for lithium-ion batteries by X-ray absorption spectroscopy