X-ray crystallography is now 100 years old so this question is probably pretty simple. Is the diffraction coming from the nucleons or the electrons in the sample? Ie. The electrons occupy a more diverse location within the sample (depending on what level/shell they occupy, in fact some may be floating around as free electrons within the sample) so I assume that x-rays are being diffracted by the nucleons and are not affected by the position of the electrons. Is this correct?