Characterization of Carbon-Encapsulated Nickel and Iron Nanoparticles by Means of X-ray Absorption and Photoelectron Spectroscopy