Currently, the structure of the X(3872) meson is unknown. Different competing models of the cc exotic state X(3872) exist, including the possibilities that this state is either a mesonic molecule with dominating D 0D * 0 + c.c. composition, a ccqq tetraquark, or a cc-gluon hybrid state. It is expected that the X(3872) state is rather strongly coupled to thepp channel and, therefore, can be produced inpp andpA collisions at PANDA. We propose to test the hypothetical molecular structure of X(3872) by studying the D orD * stripping reactions on a nuclear residue.