title: Python: Create a "Table Of Contents" with python-docx/lxml
body: <p>I'm trying to automate the creation of .docx files (WordML) with the help of python-docx (<a href="https://github.com/mikemaccana/python-docx" rel="noreferrer">https://github.com/mikemaccana/python-docx</a>). My current script creates the ToC manually with following loop:</p>
  
  <pre><code>for chapter in myChapters:
      body.append(paragraph(chapter.text, style='ListNumber'))
  </code></pre>
  
  <p>Does anyone know of a way to use the "word built-in" ToC-function, which adds the index automatically and also creates paragraph-links to the individual chapters?</p>
  
  <p>Thanks a lot!</p>