  This work presents a semi-analytical approach to answer the question of
optimal beam filtering in the case of EDXRF measurements with an X-ray tube. A
collection of programs, called xfilter, is presented that is capable to find
the optimal filter material, the optimal filter thickness, and the optimal
scattering angle, for all possible combinations of trace elements, target
materials, and tube voltages. The concepts of the calculations are introduced
in a general manner and demonstrated with a specific example, the detection of
gold K_alpha1 XRF within human tissue. Comparing the calculation results and an
EDXRF measurement shows excellent agreement.
