X-ray diffraction from a sample containing both threading and misfit dislocations calculated with the help of analytical correlation functions