  Water probes the dynamics in young stellar objects (YSOs) effectively,
especially shocks in molecular outflows. It is a key molecule for exploring
whether the physical properties of low-mass protostars can be extrapolated to
massive YSOs. As part of the WISH key programme, we investigate the dynamics
and the excitation conditions of shocks along the outflow cavity wall as
function of source luminosity. Velocity-resolved Herschel-HIFI spectra of the
H2O 988, 752, 1097 GHz and 12CO J=10-9, 16-15 lines were analysed for 52 YSOs
with bolometric luminosities (L_bol) ranging from <1 to >10^5 L_sun. The
profiles of the H2O lines are similar, indicating that they probe the same gas.
We see two main Gaussian emission components in all YSOs: a broad component
associated with non-dissociative shocks in the outflow cavity wall (cavity
shocks) and a narrow component associated with quiescent envelope material.
More than 60% of the total integrated intensity of the H2O lines (L_H2O) comes
from the cavity shock component. The H2O line widths are similar for all YSOs,
whereas those of 12CO 10-9 increase slightly with L_bol. The excitation
analysis of the cavity shock component, performed with the non-LTE radiative
transfer code RADEX, shows stronger 752 GHz emission for high-mass YSOs, likely
due to pumping by an infrared radiation field. As previously found for CO, a
strong correlation with slope unity is measured between log(L_H2O) and
log(L_bol), which can be extrapolated to extragalactic sources. We conclude
that the broad component of H2O and high-J CO lines originate in shocks in the
outflow cavity walls for all YSOs, whereas lower-J CO transitions mostly trace
entrained outflow gas. The higher UV field and turbulent motions in high-mass
objects compared to their low-mass counterparts may explain the slightly
different kinematical properties of 12CO 10-9 and H2O lines from low- to
high-mass YSOs.
