X-Ray Diffraction from Crystals with Defects