parse an XML in-memory document and build a tree. In the
      case the document is not Well Formed, a attempt to build a
       tree is tried anyway

def recoverDoc(cur):
    """parse an XML in-memory document and build a tree. In the
      case the document is not Well Formed, a attempt to build a
       tree is tried anyway """
    ret = libxml2mod.xmlRecoverDoc(cur)
    if ret is None:raise treeError('xmlRecoverDoc() failed')
    return xmlDoc(_obj=ret)