Dynamical theory of X-ray diffraction from damaged epitaxial layers with constant strain gradient