The X-ray radiation is not sufficient to knock out the inner orbital electron. As it hit the atomic plane, it scattered in all directions, which can either constructively or distructively interfere. This constructive interference gives rise to a set of incident radiation that is reflected at an angle. This reflection gives rise to diffraction So check your facts very well
While it is true that sometimes a sample has to be ground to generate a powder suitable for this technique, the chemical composition is (generally) not altered. Powder XRD is generally referred to as non-destructive in the sense that the sample presented to the instrument is not 'consumed' during the course of the experiment.