X-ray-diffraction study of in-plane and interlayer correlations in layered compounds AgxTiS2.