  The mass composition of ultra high-energy cosmic ray (UHECRs) can be inferred
from measurements of $X_{\rm max}$ distributions by fitting them with Monte
Carlo (MC) predictions for different primary species of nuclei in each energy
interval. On the basis of Monte Carlo (MC) simulations, we show that an
appropriate approach is to fit the observed $X_{\rm max}$ distributions with
all possible combinations of elements from a large set of primaries (in our
case p, He, C, N, O, Ne, Si and Fe), and to find the "best combination" of
elements which best describe the observed $X_{\rm max}$ distributions. We apply
this method to the $X_{\rm max}$ distributions recorded by the Pierre Auger
(2014) and Telescope Array (TA) (2016) Observatories in the energy range $\lg E
(\rm eV) =$ [17.8 - 19.3] and $\lg E (\rm eV) =$ [18.2 - 19.0], respectively,
by employing MC predictions of the QGSJETII-04 hadronic interaction model. The
results obtained from both data sets suggest that the mass composition of
UHECRs is dominated by protons and He nuclei ($\gtrsim 70\%$) which present a
modulation of their abundances as a function of primary energy, but keeping
their sum roughly constant. We performed an indirect comparison between the two
data sets measured by the two experiments and found a good degree of
compatibility in some energy bins around and above the \textit{ankle} ($\lg E
(\rm eV) \sim 18.7$), but worsening at lower energies. We consider that the
current approach, completed with predictions of different hadronic interaction
models, can be used in further studies on mass composition to obtain a more
accurate image of the evolution of the individual fractions of nuclei as a
function of energy on the basis of experimental $X_{\rm max}$ distributions.
