code: def parse_document(xmlcontent):
      
  
      document = etree.fromstring(xmlcontent)
  
      body = document.xpath('.//w:body', namespaces=NAMESPACES)[0]
  
      document = doc.Document()
  
      for elem in body:
          if elem.tag == _name('{{{w}}}p'):
              document.elements.append(parse_paragraph(document, elem))
  
          if elem.tag == _name('{{{w}}}tbl'):
              document.elements.append(parse_table(document, elem))
  
          if elem.tag == _name('{{{w}}}sdt'):
              document.elements.append(doc.TOC())
  
      return document
docs: Parse document with content.
  
      Content is placed in file 'document.xml'.