Analysis of stresses and crystal structure in the surface layer of hexagonal polycrystalline materials: a new methodology based on grazing incidence diffraction