code: def load_xml(fp, object_pairs_hook=dict):
      r
      tree = ET.parse(fp)
      return object_pairs_hook(_fromXML(tree.getroot()))
docs: r"""
      Parse the contents of the file-like object ``fp`` as an XML properties file
      and return a `dict` of the key-value pairs.
  
      Beyond basic XML well-formedness, `load_xml` only checks that the root
      element is named "``properties``" and that all of its ``<entry>`` children
      have ``key`` attributes.  No further validation is performed; if any
      ``<entry>``\ s happen to contain nested tags, the behavior is undefined.
  
      By default, the key-value pairs extracted from ``fp`` are combined into a
      `dict` with later occurrences of a key overriding previous occurrences of
      the same key.  To change this behavior, pass a callable as the
      ``object_pairs_hook`` argument; it will be called with one argument, a
      generator of ``(key, value)`` pairs representing the key-value entries in
      ``fp`` (including duplicates) in order of occurrence.  `load_xml` will then
      return the value returned by ``object_pairs_hook``.
  
      .. note::
  
          This uses `xml.etree.ElementTree` for parsing, which does not have
          decent support for |unicode|_ input in Python 2.  Files containing
          non-ASCII characters need to be opened in binary mode in Python 2,
          while Python 3 accepts both binary and text input.
  
      :param fp: the file from which to read the XML properties document
      :type fp: file-like object
      :param callable object_pairs_hook: class or function for combining the
          key-value pairs
      :rtype: `dict` or the return value of ``object_pairs_hook``
      :raises ValueError: if the root of the XML tree is not a ``<properties>``
          tag or an ``<entry>`` element is missing a ``key`` attribute