Context. Water is a key molecule in star and planet forming regions. Recent water line observations toward several low-mass protostars suggest low water gas fractional abundances (< 10 −6 with respect total hydrogen density) in the inner warm envelopes (r < 10 2 au). Water destruction by X-rays has been proposed to influence the water abundances in these regions, but the detailed chemistry, including the nature of alternative oxygen carriers, is not yet understood. Aims. We aim to understand the impact of X-rays on the composition of low-mass protostellar envelopes, focusing specifically on water and related oxygen bearing species. Methods. We compute the chemical composition of two proto-typical low-mass protostellar envelopes using a 1D gas-grain chemical reaction network. We vary X-ray luminosities of the central protostars and thus the X-ray ionisation rates in the protostellar envelopes.Results. The protostellar X-ray luminosity has a strong effect on the water gas abundances, both within and outside the H 2 O snowline (T gas ∼ 10 2 K, r ∼ 10 2 au). Outside, the water gas abundance increases with L X , from ∼ 10 −10 for low L X to ∼ 10 −8 − 10 −7 at L X > 10 30 erg s −1 . Inside, water maintains a high abundance of ∼ 10 −4 for L X 10 29 − 10 30 erg s −1 , with water and CO being the dominant oxygen carriers. For L X 10 30 − 10 31 erg s −1 , the water gas abundances significantly decrease just inside the water snowline (down to ∼ 10 −8 − 10 −7 ) and in the innermost regions with T gas 250 K (∼ 10 −6 ). For these cases, the fractional abundances of O 2 and O gas reach ∼ 10 −4 within the water snowline, and they become the dominant oxygen carriers. In addition, the fractional abundances of HCO + and CH 3 OH, which have been used as tracers of the water snowline, significantly increase/decrease within the water snowline, respectively, as the X-ray fluxes become larger. The fractional abundances of some other dominant molecules, such as CO 2 , OH, CH 4 , HCN, and NH 3 , are also affected by strong X-ray fields, especially within their own snowlines. These X-ray effects are larger in lower density envelope models. Conclusions. X-ray induced chemistry strongly affects the abundances of water and related molecules including O, O 2 , HCO + , and CH 3 OH, and can explain the observed low water gas abundances in the inner protostellar envelopes. In the presence of strong X-ray fields, gas-phase water molecules within the water snowline are mainly destroyed with ion-molecule reactions and X-ray induced photodissociation. Future observations of water and related molecules (using e.g., ALMA and ngVLA) will access the regions around protostars where such X-ray induced chemistry is effective.