code: def XML(uri, tc, ps, **keywords):
      '''Resolve a URI and return its content as an XML DOM.
      '''
      source = urllib.urlopen(uri, **keywords)
      enc = source.info().getencoding()
      if enc in ['7bit', '8bit', 'binary']:
          data = source
      else:
          data = StringIO.StringIO()
          mimetools.decode(source, data, enc)
          data.seek(0)
      dom = ps.readerclass().fromStream(data)
      return _child_elements(dom)[0f XML(uri, tc, ps, **keywords):
      '''Resolve a URI and return its content as an XML DOM.
      '''
      source = urllib.urlopen(uri, **keywords)
      enc = source.info().getencoding()
      if enc in ['7bit', '8bit', 'binary']:
          data = source
      else:
          data = StringIO.StringIO()
          mimetools.decode(source, data, enc)
          data.seek(0)
      dom = ps.readerclass().fromStream(data)
      return _child_elements(dom)[0]
docs: Resolve a URI and return its content as an XML DOM.