A comparative X-ray diffraction study of ferroelectric thin films and superlattices