  The bright Seyfert 1 galaxy Mrk 509 was monitored by XMM-Newton and other
satellites in 2009 to constrain the location of the outflow. We have studied
the response of the photoionised gas to changes in the ionising flux produced
by the central regions. We used the 5 discrete ionisation components A-E
detected in the time-averaged spectrum taken with the RGS. Using the ratio of
fluxed EPIC and RGS spectra, we put tight constraints on the variability of the
absorbers. Monitoring with the Swift satellite started 6 weeks before the
XMM-Newton observations, allowing to use the ionising flux history and to
develop a model for the time-dependent photoionisation. Components A and B are
too weak for variability studies, but the distance for component A is known
from optical imaging of the [O III] line to be ~3 kpc. During the 5 weeks of
the XMM-Newton observations we found no evidence of changes in the 3 X-ray
dominant ionisation components C-E, despite a huge soft X-ray intensity
increase of 60% in the middle of our campaign. This excludes high-density gas
close to the black hole. Instead, using our time-dependent modelling, we find
low density and derive firm lower limits to the distance of these components.
Component D shows evidence for variability on longer time scales, yielding an
upper limit to the distance. For component E we derive an upper limit to the
distance based on the argument that the thickness of the absorbing layer must
be less than its distance to the black hole. Combining these results, at the
90% confidence level, component C has a distance of >70 pc, component D between
5-33 pc, and component E >5 pc but smaller than 21-400 pc, depending upon
modelling details. These results are consistent with the upper limits from the
HST/COS observations of our campaign and point to an origin of the dominant,
slow (v<1000 km/s) outflow components in the NLR or torus-region of Mrk 509.
