The detection of the first gravitational wave (GW) transient GW150914 prompted an extensive campaign of follow-up observations at all wavelengths. Although no dedicated XMM-Newton observations have been performed, the satellite passed through the GW150914 error box during normal operations. Here we report the analysis of the data taken during these satellite slews performed two hours and two weeks after the GW event. Our data cover 1.1 square degrees and 4.8 square degrees of the final GW localization region. No credible X-ray counterpart to GW150914 is found down to a sensitivity of 6E-13 erg/cm2/s in the 0.2-2 keV band. Nevertheless, these observations show the great potential of XMM-Newton slew observations for the search of the electromagnetic counterparts of GW events. A series of adjacent slews performed in response to a GW trigger would take <1.5 days to cover most of the typical GW credible region. We discuss this scenario and its prospects for detecting the X-ray counterpart of future GW detections.