code: def parseXRDS(text):
      
      try:
          element = ElementTree.XML(text)
      except XMLError, why:
          exc = XRDSError('Error parsing document as XML')
          exc.reason = why
          raise exc
      else:
          tree = ElementTree.ElementTree(element)
          if not isXRDS(tree):
              raise XRDSError('Not an XRDS document')
  
          return tree
docs: Parse the given text as an XRDS document.
  
      @return: ElementTree containing an XRDS document
  
      @raises XRDSError: When there is a parse error or the document does
          not contain an XRDS.