Diffraction of x-rays in capillary waveguides