X-ray photoemission spectra of the 4d levels in rare-earth metals