Text this: X-ray absorption spectroscopy study of battery materials