Disclosed are an X-ray fluorescence (SRF) spectrometer and method for on-site and in-line determination of contaminant elements in lubricating oils and in fuel oils on board a marine vessel. An XRF source block 13 contains two radionuclide sources 16, 17 (e.g. Cd 109 and Fe 55), each oriented 180 degrees from the other to excite separate targets. The Cd 109 source 16 excites sample lube oil flowing through a low molecular weight sample line 18. The Fe 55 source 17 excites fuel oil manually presented to the source beam inside a low molecular weight vial 26 or other container. Two separate detectors A and B are arranged to detect the fluorescent x-rays from the targets, photons from the analyte atoms in the lube oil for example, and sulfur identifying x-rays from bunker fuel oil for example. The system allows both automated in-line and manual on-site analysis using one set of signal processing and multi-channel analyzer electronics 34, 37 as well as one computer 39 and user interface 43.