Application of X-ray diffraction in Laue geometry to imperfect near-surface layers