X-Ray and Neutron Diffraction in Nonideal Crystals