I can also highly recommend the ICP method, but the disadvantage is that with this method only solutions can be analyzed. You would have to dissolve the magneisum in a suitable acid beforehand. Nevertheless it's a very good method.
A better solution is maybe the carrier gas hot extraction (e. g. LECO company). This allows the quantitative determination of gases in very small concentrations (ppm).
The samples given in the hot graphite crucibles are melted and release oxygen, nitrogen and hydrogen into the carrier gas. The oxygen compounds react with the hot graphite in the crucible to form carbon monoxide (CO) and carbon dioxide (CO2). Nitrogen compounds form elementary nitrogen (N2), while hydrogen compounds in the form of hydrogen gas (H2) are released. These gases are transported out of the crucible via an inert carrier gas flow (helium or argon) and then flow through a heated reagent, which oxidizes CO to CO2 and H2 to H2O. A non-dispersive CO2 infrared measuring cell (NDIR) is used to determine the oxygen content of the sample.
After removal of H2O and CO2 from the carrier gas flow, the nitrogen content is determined as N2 at the thermal conductivity.
The advantage of both methods (e. g. compared to EPMA) is that the information comes from the entire volume and not only from one surface layer.