Rietveld texture and stress analysis of thin films by x-ray diffraction