Quasar spectral variability from the XMM-Newton serendipitous source catalogue