  We present Herschel observations of the water molecule in the massive
star-forming region W3 IRS5. The o-H17O 110-101, p-H18O 111-000, p-H2O 22
202-111, p-H2O 111-000, o-H2O 221-212, and o-H2O 212-101 lines, covering a
frequency range from 552 up to 1669 GHz, have been detected at high spectral
resolution with HIFI. The water lines in W3 IRS5 show well-defined
high-velocity wings that indicate a clear contribution by outflows. Moreover,
the systematically blue-shifted absorption in the H2O lines suggests expansion,
presumably driven by the outflow. No infall signatures are detected. The p-H2O
111-000 and o-H2O 212-101 lines show absorption from the cold material (T ~ 10
K) in which the high-mass protostellar envelope is embedded. One-dimensional
radiative transfer models are used to estimate water abundances and to further
study the kinematics of the region. We show that the emission in the rare
isotopologues comes directly from the inner parts of the envelope (T > 100 K)
where water ices in the dust mantles evaporate and the gas-phase abundance
increases. The resulting jump in the water abundance (with a constant inner
abundance of 10^{-4}) is needed to reproduce the o-H17O 110-101 and p-H18O
111-000 spectra in our models. We estimate water abundances of 10^{-8} to
10^{-9} in the outer parts of the envelope (T < 100 K). The possibility of two
protostellar objects contributing to the emission is discussed.
