  The quantum numbers J^PC = 1++ of the X(3872) and the proximity of its mass
to the D*0 anti-D0 threshold imply that it is either a loosely-bound hadronic
molecule whose constituents are a superposition of D*0 anti-D0 and D0 anti-D*0
or it is a virtual state of charm mesons. The line shapes of the X(3872) can
discriminate between these two possibilities. At energies within a few MeV of
the D*0 anti-D0 threshold, the lines shapes of the X produced in B -> K
transitions are determined by its binding energy and its width. Their
normalizations are determined by a short-distance constant that is different
for B+ -> K+ and B0 -> K0. At energies comparable to the 8 MeV splitting
between the D*0 anti-D0 and D*+ D- thresholds, the charged meson channels D*+
D- and D+ D*- have a significant effect on the line shapes of the X. We
calculate the line shapes taking into account the resonant coupling between the
charged and neutral 1++ channels. The line shapes and their normalizations
depend on one additional scattering parameter and two additional short-distance
constants associated with the B -> K transitions. The line shapes of the X
resonance depend on its decay channel; they are different for J/psi pi+ pi-,
J/psi pi+ pi- pi0, and D0 anti-D0 pi0. The line shapes are also different for X
produced in B+ decays and in B0 decays. Some conceptual errors in previous work
on this problem are pointed out.
