The use of a detailed Monte Carlo simulation code for X-ray fluorescence sp
ectrometers is demonstrated for calculating the outcome of X-ray scattering
experiments in the incident energy range 40-80 keV. The code was validated
by comparisons of experimental and simulated spectral distributions in the
case of thick, homogeneous samples in which multiple photon scattering occ
urs with high probability. The experimental spectral distributions were col
lected at beamline BW5 of HASYLAB, Germany, where a highly energetic, monoc
hromatic synchrotron beam is available. With respect to heterogeneous sampl
es, the code was employed to evaluate the use of Rayleigh and Compton scatt
er signals for obtaining three dimensional information on the sample dark m
atrix composition.