On a global level, legal regulations within the framework of correct waste management are, fortunately, increasingly numerous and detailed in their requirements. Compliance with waste management requirements requires the characterization of the waste being handled, and for doing this the fastest possible analytical procedures are essential. In particular, under the premises of the circular economy, many states have established regulations that favor the recycling of organic matter and nutrients contained in organic waste, such as manure, sewage sludge, and selectively collected municipal waste. While setting the agronomic quality of organic waste and its derived products (compost, growing media, amendments, and organic fertilizers) to maintain a high environmental quality standard, these regulations emphasize the absence of elements and potentially polluting substances, among which are heavy metals and various trace elements.
It is very fast and allows you to obtain results in minutes;
Pre-sample preparation can be significantly reduced. Although it may be convenient to carry out the sample drying and grinding steps, the laborious digestion steps are avoided;
Hardly any laboratory waste is generated (in particular, acid digestion solutions are avoided), making it a green laboratory technique;
Used in the laboratory, the space required is much less than that required by other conventional techniques;
Under proper supervision, the personnel performing the measurements do not require advanced training in analytical techniques;
The price of the equipment is less than that of conventional techniques, which, together with its greater speed, lowers the unit costs of analysis;
Its use in the field allows, at least qualitatively, on-site verification, in situ decision-making, or the selection of the most appropriate samples for a broader research.
2. Determination of Elemental Content with pXRF
Chronologically, the following research on the subject is that of McWhirt et al. 
in 2012. The authors calculated LOD in compost samples for the elements As, Ca, Cd, Cr, Cu, Fe, K, Mn, P, and Zn and stated substantial improvements for all elements compared to the previous research by Weindorf 
attributable to improvements in technology. Their conclusion was that pXRF was able to acceptably quantify Ca, Cr, Cu, Fe, K, Mn, P, and Zn in dry samples but the divergences were important for As and Co.
Healy et al. 
characterized metals in Irish sludges that had undergone treatment by thermal drying, lime stabilization, or anaerobic digestion. Correlation coefficients between pXRF and ICP-MS (aqua regia
digestion) results indicated the suitability and satisfactory use of the pXRF technique for the quantification of Fe, Cu, Se, Zn, and Pb (r > 0.90). However, it should be noted that the regulated levels in sludge are higher than for other amendments.
Shand and Wendler 
used pXRF for soil analysis but, being Scottish peat soils with very high OM contents, it is really equivalent to the matrices. Shand and Wendler determined the LOD in the organic soils and found values below 5 mg kg−1
for Cr, Ni, Zn, As, and Sr, values between 5–10 mg kg−1
for Cu, and values between 10–15 mg kg−1
for Mn and Pb. These LOD indicated better sensitivity for Cr, Ni, and Zn and worse for Mn and Pb (and also Fe and Ca) compared to the previous McWhirt study 
. The authors compared the concentrations of K, Ca, Ti, Cr, Mn, Fe, Ni, Cu, Zn, As, Sr, and Pb determined by pXRF with pseudototal
concentrations determined by aqua regia
extraction and ICP-OES. Their results indicated that the in-built calibrations of the instrument were not adequate for these organic soils and should be modified. The authors indicated that mineral or peat soils were not completely dissolved by the aqua regia
reflux procedure they used, leaving behind undissolved refractory minerals such as quartz and feldspars, so comparison of aqua regia
extraction with pXRF analysis is not straightforward. Nevertheless, the authors attribute the difference between the pXRF vs. aqua regia
extractable analysis to matrix effects in the pXRF and not to low recovery by aqua regia
Although it does not appear in the database searches undertaken, it is necessary to cite the research by Tighe and Forster 
. The authors applied pXRF to litter analysis and found good results only for the major elements calcium and potassium.
In 2018, two studies by Weindorf et al. 
and Li et al. 
adapted methods developed for soils and used elemental data as a proxy for the prediction of derived properties, such as compost electrical conductivity (EC) and cation exchange capacity (CEC), respectively. To calculate the elemental contents, the recovery percentages based upon NIST certified reference material 2711a were used to establish correction factors for each element.
Havukainen et al. 
compared the concentrations obtained by pXRF with those by ICP-MS (following nitric-hydrochloric acids microwave digestion) in several types of waste: fine fraction reject from solid recovered fuel production, fly ash, biowaste, and compost. The results obtained by the two methods were unacceptably divergent. Regression analysis showed a linear correlation only with Ca and Zn values and, thus, linear correction to transform pXRF results to be comparable to ICP-MS results could be possible for these elements. Nevertheless, pXRF is reported to be best suited for samples such as ash and compost because of their following physical properties: not too moist, quite small particle size, and not too heterogeneous. The authors concluded that various factors such as sample moisture content, physical and chemical matrix effects (e.g., inter-element effects, particle size, and homogeneity), instrument resolution, and inconsistent sample positioning affected the reliability of the measurement.
Thomas et al. 
used pXRF to measure the total elemental content of soils, crops, and organic fertilizer samples (anaerobic digestate, compost, farmyard manure, and straw). The authors measure several nutrients in the amendments but it is not indicated if another comparison method was used. In the case of soils, it is indicated that a CRM sample was used and that the soil calibration does not predict potassium with accuracy, and underpredicts 2–3-fold.
López-Núñez et al. 
used the technique for organic samples from an interlaboratory program that determined certified aqua regia
contents. They found good linear correlations between measured and certified values of 16 elements when corrections were applied to pXRF elemental readings by measurements of other main elements, with silicon content being one of the most influential fitting terms in eight of the modelling equations. These results indicate that the low recovery of the aqua regia
extraction, due to its inability to dissolve silicates, could be responsible for the poor fit of pXRF results when not compared to total matrix digestion.
In the study by Sapkota et al. 
, the correlations among pXRF and ICP-OES (nitric acid digestion) were strong (R2
> 0.90) for all elements (P, K, Ca, Mg, Fe) except Mg (R2
= 0.59) in dried samples (<10% moisture).
Analogous to the previous research, Horf et al. 
compared pXRF and ICP-OES and found R2
above 0.8 for the elements P, K, Mg, Ca, S, Mn, Fe, Cu, and Zn when analyzed in dry manure samples. The authors found a clear tendency of improving regression models due to drying, but the R2
was satisfactory (only) for K in fresh and liquid samples. Despite the goodness of the regression coefficients, the slopes of several elements (Ca, Cu, Zn, Fe, K) were greater than unity (greater concentration by pXRF than by ICP-OES). Although the authors indicate that the digestion they applied did not yield total concentrations, they considered this to be a small effect that cannot explain the high slopes and considered the bias to be due to element-specific matrix-dependent effects.
The LOQs of pXRF or their respective LODs are poorer than those of large laboratory-based XRF instruments or of ICP-related techniques.
Several of the previous studies 
also evaluated the influence of other factors that will be outlined in the following sections.
The above studies highlight the limited use of pXRF for the analysis of organic amendments. Despite the fact that the evolution of the technique has led to better detection limits that would have allowed the measurement of almost all the elements of interest in these matrices, the results of the various studies are contradictory. In general, they show important divergences between the results obtained by pXRF and the reference analytical procedure used in each study. There may be different reasons to account for these divergences. One explanation could be the different calibration strategies they have used. In a majority of studies, the pre-calibrated method called “Soil” has been used in the instruments, but in some studies other pre-calibrated procedures have been used. More information about pre-calibrated analytical modes in different pXRF instruments and their relevance and applicability to geochemical investigations can be found in a recent research by Laperche and Lemière 
. On some occasions, calibration corrections based on measurements made in reference samples have been used. Measurement results should have been validated by the analysis of a suitable reference material but this procedure has not always been followed. On many occasions, the CRMs used are soils or sediments in the absence of similar organic materials certified for XRF. It is possible that the different pre-calibrations, by making use of different spectral peaks for the same element and different correction formulas, may give rise to different deviations due to the sample matrix, causing a good fit of some elements in some matrices and not in others.
In most of the studies discussed, the comparison of methods (pXRF vs. wet chemistry method) was elucidated by calculating the correlation (r) or the regression (r or R2
and slope) between both procedures. Especially for the case of comparing a simple or approximate method (as is the case of the pXRF measurement of the elements in concentrations closer to the LOQ) with a more precise one, these statistical parameters are inadequate to determine the similarity of methods, as Altman and Bland revealed in their classic work 
. It would be necessary to use other methods for the statistical comparison of the procedures.
However, the probable reason for the lack of adjustment between the measurements with pXRF and the chosen reference procedure lies in the different recovery that can be obtained with the different extractant mixtures used (aqua regia
, nitric acid, with or without hydrofluoric acid (HF)) and even the different extraction conditions (microwave, open digestions). García-Delgado et al. 
tried different digestion procedures on amendments and found that microwave HF acid mixtures obtained the highest trace element recoveries for all tested metals except Al. They verified that Cr, Fe, Ni, and Pb were mainly associated with the residual fraction of the BCR sequential extraction procedure, suggesting that these metals were primarily contained in silicates and other resistant minerals. García-Delgado et al. 
found the recoveries for Cr, Ni, Mn, Fe, and Pb were between 11% and 23% greater than for non-HF extractions. The recoveries for Cu, Zn, and Cd were about 10% higher when HF was used. The Si recovery was negligible if HF was not used, while that of Al hardly reached 50%. Similar results were obtained for Cu, Fe, and Al recoveries in a similar work by Sandroni and Smith 
using a sewage sludge CRM. The acid mixtures with HF more efficiently attacks aluminosilicates and the metals extracted with HF were absorbed into aluminosilicate compounds, so aqua regia
and nitric acid were not able to extract them completely.
3. Organic Matter Effect
Surprisingly, there are no studies evaluating the effect that organic matter content may have on pXRF readings in organic amendment matrices. This effect in soils has been recently research by Silva et al. 
when evaluating the application of pXRF in tropical soils. There is common agreement that soil organic matter may cause a scattering and attenuation of signals when a soil sample is irradiated by X-rays and that the influence and interference magnitude of soil organic matter are still poorly understood. Consequently, the result for a target element could be modified.
Probably the most detailed study in this regard is that of Ravansari and Lemke 
. In their study, three organic matter substitutes (cellulose, graphite powder, and confectioner’s sugar) were added to a soil standard reference material and the concentrations of 13 elements (As, Cr, Cu, Fe, Mn, Pb, Rb, Sr, Th, Ti, V, Zn, and, Zr) were measured as a function of variable organic matter fractions. Their results demonstrate the attenuation of the pXRF signal with the increase in the organic matter fraction of the sample, although the deviations depend on each element. For example, pXRF-Pb concentrations were not affected, pXRF-As concentrations were underestimated, and Mn showed a more complex behavior, both overestimating and underestimating depending on its concentration. The correction factors for the effect of organic matter were generally less than ±8% for organic matter contents up to 30%.
Costa et al. 
verified the effect of organic matter removal on oxides determination by pXRF in soil samples (<2 mm) and their clay fraction. The soil organic matter presence led to underestimation of the pXRF results for the lightest oxides (Si and Al) compared to the heaviest oxides (Fe, Ti, and Mn) which were less affected. Soil organic matter in these samples was below 4.4% (44 g kg−1
), which is a content one order of magnitude lower than that found in organic amendments. The lightest elements have lower XRF photon energy values and, as a consequence, the effect of organic matter coating the soil particles can be more pronounced. The reduction of the SiO2
content reached 20–22.5% with respect to the content of the mineral soil (3–5% as SiO2
). The reduction of contents of the light oxides (SiO2
) can be considered relevant. On the contrary, Fe2
and MnO content reductions obtained by pXRF can be considered irrelevant with variation before and after organic matter combustion lesser than 1%. The authors indicate that the possible effect of organic matter may be related to the scattering of primary and secondary X-rays, underestimating the results, in the same way that has been observed for soil with a high moisture content.
Shand C.A. and Wendler R. 
evaluated pXRF analysis of peat and organic soils. They found in an ombrotrophic peat, satisfactory results for Cu (certified content 5.28 ± 1.04 mg kg−1
) and Pb (certified content 174 ± 8 mg kg−1
) but the concentrations of Ca, Ti, Cr, Ni, and Zn were overestimated by 2–3 times, and Fe by 5 times. In the same study, they analyzed the concentrations of K, Ca, Ti, Cr, Mn, Fe, Ni, Cu, Zn, As, Sr, and Pb of 183 Scottish topsoils that had a wide range of organic carbon (OC) concentrations (1.23 to 48.8%). They concluded that modifications to manufacturer calibrations are needed and that empirical calibration of XRF instruments requires unavailable certified reference peats and peat soils, certified for total element concentration across a wide range of elements.
In a recent study, Sut-Lohmann et al. 
compared the feasibility of common laboratory methods (microwave plasma-AES and pXRF) to evaluate element concentrations in soil highly influenced by sewage waste. The lowest correlation between both methods was obtained for Ni (R2
= 0.70, stronger points scattering), although the correlations were satisfactory for the other elements (Pb, Cu, Zn and Cr). The authors also approached another strategy for the analysis of organic samples with pXRF: the elimination by ignition of the organic matter to then carry out the readings in the calcined samples. This same sample calcination strategy was already used by Vodyanitskii et al. 
to measure the metals Ba, Sr, V, Cr, Ni, Cu, Zn, Zr, Pb, Y, La, and Ce, although in this case, a nonportable laboratory instrument was used. Sut-Lohmann et al. 
found that OM removal in the soil sample influences its density and effective volume, which interferes with pXRF elemental analysis. However, if the data were corrected for organic matter, the influence of the matrix on the pXRF measurements was reduced. Their conclusion was that results validate a usage of pXRF as an alternative method for the conventional wet-chemical-based AES analysis for soil samples highly influenced by sewage wastes. However, the authors indicate that the prior calcination invalidates the use of the technique in the field.
4. Effect of Moisture Content
Although pXRF is used in many different field applications involving the measurement of wet and even liquid samples, it is an accepted fact that water causes a decrease in the pXRF signal 
. In various geological and environmental applications, the effect of moisture content has been shown to be linear, creating a dilution effect on pXRF signals. Under these circumstances, the fit of the pXRF measurements is improved simply by applying a correction factor 
Working with compost from several feedstocks, Weindorf et al. 
found that pXRF moist scans produced overall lower means than both ICP-OES and pXRF dry data. The R2
values also worsened in all moist models when compared with the corresponding dry dataset. However, the determination of Cu, Pb, and Zn concentrations of compost samples in situ was possible as sample moisture showed little influence on predictability.
Havukainen et al. 
studied the results in moist and dried samples of biowaste and compost. The element concentrations of the moist and the dry samples, expressed both on a dry matter basis, were closer to each other for compost samples (−10 to 10%) than for biowaste samples (−37 to 33%) due to the greater moisture content of biowaste samples (almost double on average). However, the direction of the difference depends on the element: Zn, Cu, and K presented lower values in the humid samples while Ca and Cl presented higher values with humidity.
Sapkota et al. 
dedicated a study to the objectives of quantifying the effect of sample moisture content, predicting moisture content, and correcting for moisture effect on elemental concentration determinations in livestock manure. They found that the average intensity of P, K, Ca, Mg, and Fe decreased with increasing sample moisture content. This result in the case of Ca is contrary to that of the previous research by Havukainen et al. 
. An interesting result is that the authors were able to determine the moisture content (R2
= 0.98) using pXRF spectrum data and random forest regression. For this, they used peaks from the spectrum included in regions that were free of the elemental signals and that had great predictive power for the moisture content. In this way, elemental concentrations could be predicted in all wet samples, with R2
ranging from 0.90 for element Mg (in order to determine this element, the measurements were made under vacuum conditions) to 0.98 for element Fe.
A research of the effects of moisture on pXRF soil analysis was recently undertaken by Silva et al. 
. Although the use of pXRF in soils and sediments has been more widespread than in organic amendments, the authors pointed out discrepancies between different studies and indicated that the general influence of humidity is only known between elements that are less or more affected (such as light elements Z < 26 or elements with detectable X-ray fluorescence energy less than 5 keV).
The presence of water in the measured sample can affect the result in several ways:
Dilution of the sample by the additional weight of water since the results are normally expressed on a dry matter basis;
By absorbing part of the primary incident X-rays;
By scattering the secondary X-rays.
Regarding dilution, it is a linear effect and researchers must bear in mind that in organic matrices the water content in situ can be much higher than in mineral matrices such as soil. Water absorption is precisely one of the beneficial effects of organic matter for plant growth. Therefore, the linear factors for the conversion of results from a fresh basis to dry basis could be much higher in the case of organic matrices. Organic amendments are also made up of discrete particles. Each particle can be mostly organic (e.g., plant debris) or mostly mineral (soil particles or small rock fragments). The concentration of chemical elements in these different types of particles can be very different 
; plant nutrients are concentrated in organic materials, while Si, Al and trace elements are usually enriched in the fine fractions; and the water contained in a wet sample can also preferentially be associated with particles of an organic type. The result is that geometrically the distribution of water and chemical elements in the particles of an organic amendment sample is not homogeneous. Therefore, the effects of incident radiation absorption and secondary scattering could vary depending on the specific characteristics of each organic amendment. This could be one of the reasons for the disparity in results that has been mentioned, both for organic amendments and also for soils. The effects of organic matter content and moisture content are likely to overlap when fresh samples are analyzed. In addition, its separation for statistical purposes or for modeling and correcting results could be complicated if a heterogeneous set of samples is studied. The moisture content of an organic sample can also have another effect that has not normally been considered in previous studies. The increase in humidity in organic amendments usually leads to a decrease in apparent density; this is a compaction of the sample 
. This is a well-known physical property of organic growing media referred to as shrinkage 
. In the case of highly compactable materials, this could lead to a high interaction between the effects of organic matter and moisture content, possibly accentuated in conditions close to saturation of the sample with water.
In most of the studies discussed, comparisons of the pXRF technique with other laboratory procedures such as digestion followed by measurement by ICP-OES have been made. In these cases, pXRF has generally been used in the laboratory, after drying, grinding, and sieving the samples, which reduces problems of heterogeneity and facilitates the comparability of procedures under the same conditions.
5. Other Measurement Conditions
Despite the portable nature of pXRF instruments, most previous studies have been dedicated to standardizing the conditions for the comparisons and calibrations they performed, and thus used the instrument under laboratory conditions. The most common is to place the dry and finely ground sample in XRF sample cups, which are covered with a sufficiently thin protective plastic film. The most used films are 4 µm prolene 
and 4 µm polypropylene 
, although some researchers made the measurements directly in plastic (unspecified) bags 
. The thin film between the sample and the X-ray detector can attenuate or scatter fluorescence signals. Thin films attenuate to some extent the low-energy fluorescence signatures from light elements (e.g., Al) but exert negligible attenuation effects on heavier elements. The use of thicker protective barriers such as plastic bags can cause significant effects on measurements for lighter elements. A 50 μm polypropylene barrier attenuates 94% of the aluminum Kα signal 
. The effects of protective films should be determined for each intended application. Measurements can be made by positioning the capsule or plastic bag directly on the nose of the instrument, or in the opening of a radiation protection stand that allows the instrument to be attached.
The aforementioned studies on amendments also show wide variations in terms of sample thickness. The sample thicknesses used range from a maximum of 10 cm to 32 mm, 23 mm or greater than 2 cm. In many cases, they do not refer to thickness but to sample weight, from 0.5 g to 10 g, which will reach a different thickness depending on the volume of the sample cup. In their research of factors affecting the environmental assessment of soils with pXRF, Ravansari et al. 
indicated that the literature is inconsistent regarding required sample thickness and a consensus has not been reached. The pXRF analysis must be performed on infinitely thick samples or. in other words, with a thickness (and diameter) greater than the specific critical thickness of the analyte. If the samples are not infinitely thick, the detected intensities may decrease because the area from which the signal contribution should occur may be replaced by air. The incident beam can penetrate more into organic matrices, so the critical thicknesses in these cases can be greater. As there is no consensus regarding the critical thicknesses (there are published values from 5 to 25 mm) nor a standard procedure to determine them, it must be ensured that the thickness of the infinitely thick sample is reached in each type of matrix 
6. Derived Properties
One of the advantages of the pXRF technique is that it can provide extensive information about the chemical composition of a sample. All elements present in concentrations above the LOD from Na (atomic number 11) to U (atomic number 92) can be determined in one quick scan, although special conditions, such as a vacuum, may be necessary for the lighter elements. Having this extensive information on the elemental composition of the sample allows the use of chemometric procedures to predict other physical–chemical properties of the samples.
As mentioned previously, in 2018, the studies by Weindorf et al. 
and Li et al. 
used elemental data as a proxy for the prediction of derived properties such as compost electrical conductivity (EC) and cation exchange capacity (CEC), respectively. For the modelling of the derived properties, a principal component regression (PCR) model was used in the Weindorf et al. study for EC and pH, while random forest (RF) regression was used in the Li et al. study for CEC. Measured vs. pXRF predicted compost EC correlated well (coefficient of determination, R2
= 0.80; root mean squared error, RMSE = 1.04 dS m−1
) and CEC showed excellent correlation (R2
= 0.90, RMSE = 5.41 meq 100 g−1
, for the calibration set of samples). Compost pH was reasonably explained via pXRF (R2
= 0.63, RMSE = 0.35), although the fit was not as good as for the other parameters.
López et al. 
showed that it was also possible to determine the organic matter content of organic amendment samples from linear regression equations that use the undetermined content data (the difference to 100% of all the elements actually measured) with corrections from elements such as silicon, calcium, or iron. The same authors 
found multiple linear regression equations that can predict aqua regia
-soluble concentrations of the elements As, Cd, Cr, Hg, Ni, and Se using pXRF readings of other measurable elements as predictor variables. These target elements were below the LODs of the pXRF instrument used. Several amendment type-dependent singles or multiple linear functions were found based on one, two, or three predictors. The predictor readings corresponded to the concentration of elements of geogenic (Fe, Si, Ti, Cl, Zr Al, Ca, S, Mn, and Ba), anthropogenic (Zn and Pb), and agricultural (P and K) origin. The regression coefficients of these functions were r = 0.90–0.99.
In a recent paper, Towet et al. 
proposed two types of machine learning methods, forest regression and extreme gradient boosting, for the prediction of ash content, total carbon, nitrogen, and several elements from both pXRF and Diffuse Reflectance Fourier-transform mid-infrared spectroscopy (DRIFT-MIR) data using 98 samples of various organic amendments. The authors found very good regressions from pXRF data for ash, total C, total N, P, K, Ca, S, and Fe (R2
> 0.90) and acceptable regressions for the elements Mg, Na, and Mn (0.7 > R2
> 0.9). In general, the pXRF data gave better predictions for heavier elements and the DRIFT-MIR data gave better predictions for ash, carbon, and lighter elements.