Complex XRD microstructural studies of hard coatings applied to PVD-deposited TiN films Part I. Problems and methods