An instrumentation of X-ray absorption spectroscopy (XAS) was developed to measure the areal density of any element with an atomic number Z > 17. In contrast to X-ray fluorescence, which is affected by spatial dopant nonuniformity, an element can be accurately measured by XAS regardless of its own distribution or the presence of other elements in a sample. Furthermore, no reference standard is needed to achieve ±3% 1 accuracy. This method has been used to measure the average contents of specific elements in a variety of inertial confinement fusion and high energy density targets. It validates the average dopant concentration measured by contact radiography and differential radiography.