Residual stress measurement by X-ray diffraction