X-ray absorption spectroscopy study of hydrogen bonded system is presented. The electronic structure of water is strongly influenced by the local hydrogen-bonded configurations. At the surface and bulk defects of ice, there are electronic states localized on broken (or dangling) hydrogen bonds. Broken hydrogen-bonded configurations and electronic states in liquid water are also shown.