I sometimes use it to analyze soil samples in the field. Since you aren't necessarily shooting a homogeneous substance, you sometimes get results that don't reflect the overall concentration. To get meaningful data you have to send it to a fixed lab where they will extract it and get an analytical result that is more likely to reflect the real concentration.
Actually, XRFs are commonly used by industrial hygienists to determine concentrations of lead (Pb) in lead paint. In fact, the new renovation, repair and paint (RRP) law that went into effect on April 22 assumes lead is in paint on homes built before 1981, unless the paint is measured to be less than 0.5% lead. The best way to do so (per EPA) is to use an XRF to determine whether lead is present or not, and what its concentration is. Alternatively, paint chips can be analyzed for lead in a laboratory; however, one can obtain 200-300 measurements for lead in a building with an XRF, whereas one may take 10-20 paint chip samples in the same time. What I'm guessing happened is than an IH used an XRF on a glass that his/her kid brought home from McDonalds and found some aberrant spectra - the IH took those readings further, and found the spectra matched cadmium. He/She then sent the glass with the readings to the Congresswoman. Given that cadmium has been substituted for lead in kid's toys, etc. (which was prohibited by law), and cadmium is considerably more toxic than lead, the Congresswoman had the glass tested, and the recall began.
Enzymes are things invented by biologists that explain things which otherwise require harder thinking. -- Jerome Lettvin