A long-term study of AGN X-ray variability: structure function analysis on a ROSAT-XMM quasar sample