Study of stress gradients using synchrotron X-ray diffraction