Starting from a molecular picture for the X(3872) resonance, this state and its J(PC) = 2(++) heavy-quark spin symmetry partner [X-2(4012)] are analyzed within a model which incorporates possible mixings with 2P charmonium (c (c) over bar) states. Since it is reasonable to expect the bare chi(c1)(2P) to be located above the D (D) over bar* threshold, but relatively close to it, the presence of the charmonium state provides an effective attraction that will contribute to binding the X(3872), but it will not appear in the 2(++) sector. Indeed in the latter sector, the chi(c2)(2P) should provide an effective small repulsion, because it is placed well below the D*(D) over bar* threshold. We show how the 1(++) and 2(++) bare charmonium poles are modified due to the D-(*)(D) over bar ((*)) loop effects, and the first one is moved to the complex plane. The meson loops produce, besides some shifts in the masses of the charmonia, a finite width for the 1(++) dressed charmonium state. On the other hand, X(3872) and X-2(4012) start developing some charmonium content, which is estimated by means of the compositeness Weinberg sum rule. It turns out that in the heavy-quark limit, there is only one coupling between the 2P charmonia and the D-(*)(D) over bar ((*)) pairs. We also show that, for reasonable values of this coupling, leading to X(3872) molecular probabilities of around 70-90%, the X2 resonance destabilizes and disappears from the spectrum, becoming either a virtual state or one being located deep into the complex plane, with decreasing influence in the D*(D) over bar* scattering line. Moreover, we also discuss how around 10-30% charmonium probability in the X(3872) might explain the ratio of radiative decays of this resonance into psi(2S) gamma and J/psi gamma Finally, we qualitatively discuss within this scheme, the hidden bottom flavor sector, paying a special attention to the implications for the X-b and Xb(2) states, heavy-quark spin-flavor partners of the X(3872).