Determination of nanoparticle sizes by X-ray diffraction