X-ray diffractometry of small defects in layered systems