Textured thin film of PbTiO3 on glass and both textured and stressed films of TiB2 on iron substrate were investigated by two-dimensional reciprocal space mapping. The texture and residual stress parameters were found by fitting of the measured intensity in the reciprocal space map by the simulated data. Two different types of texture were found in TiB2 for different values of residual stress. The relevance of resulting parameters was checked using different models. Simulation of the data involved a proper empirical texture correction, the Pearson VII profile function, the irradiated volume correction giving a possibility of the film thickness determination, the background, and other correction factors (Lorentz, polarisation).