Characterization of metal nanoparticles by X-ray photoelectron spectroscopy