X-ray-spectroscopy analysis of electron-cyclotron-resonance ion-source plasmas