  We analyze how the renowned X(3872), a weakly bound state right below the $D
\bar D^*$ threshold, should effectively be included in a hadronic
representation of the QCD partition function. This can be decided by analyzing
the $D \bar D^*$ scattering phase-shifts in the $J^{PC}=1^{++}$ channel and
their contribution to the level density in the continuum from which the
abundance in a hot medium can be determined. We show that in a purely molecular
picture the bound state contribution cancels the continuum providing a
vanishing occupation number density at finite temperature and the $X(3872)$
does not count below the Quark-Gluon Plasma crossover happening at $T \sim
150$MeV. In contrast, within a coupled-channels approach, for a non vanishing
$c \bar c$ content the cancellation does not occur due to the onset of the
$X(3940)$ which effectively counts as an elementary particle for temperatures
above $T \gtrsim 250$MeV. Thus, a direct inclusion of the $X(3872)$ in the
Hadron Resonance Gas is not justified. We also estimate the role of this
cancellation in X(3872) production in heavy-ion collision experiments in terms
of the corresponding $p_T$ distribution due to a finite energy resolution.
