Sol–gel derived hybrid materials doped with rare earth metal ions