X-ray photoelectron spectroscopy of rare-earth compounds