Characterization of Ni-P and Fe-P by X-ray absorption spectroscopy