Sample preparation for X-ray diffraction