The deformation mode and defect structure of AlxGa1 – xN:Si epitaxial layers (x = 0–0.7) grown by molecular beam epitaxy and doped with Si under a constant silane flux are studied by X-ray diffractometry. The concentration of Si atoms in the layers measured by secondary ion mass spectrometry is (4.0–8.0) × 1019 cm–3. It is found that the lateral residual stresses are compressive at x < 0.4 and become tensile at x > 0.4. The stresses after the end of growth are estimated and the contribution to the deformation mode of the layers of both the coalescence of nuclei of the growing layer and misfit stresses in the layer–buffer system are discussed. It is found that the density of vertical screw and edge dislocations are maximal at x = 0.7 and equal to 1.5 × 1010 and 8.2 × 1010 cm–2, respectively.