X-ray Diffraction and Reflectivity Analysis of Thin Films and Nanomaterials