title: How to read bookmarks that are outside of a paragraph with Apache POI XWPF
body: <p>Sometimes, when defining a bookmark in a <code>.docx</code> file (using Word 2016 in this case), the bookmark start tag (<code>&lt;w:bookmarkStart&gt;</code>) is placed by MS Word before the start of the paragraph. Unzipping the <code>.docx</code> file reveals the following:</p>
  <pre><code>&lt;w:bookmarkStart w:id=&quot;38&quot; w:name=&quot;MyBookmark&quot;/&gt;&lt;w:p w14:paraId=&quot;1B2F3A46&quot; ...&gt;...
  &lt;w:bookmarkEnd w:id=&quot;38&quot;/&gt;&lt;/w:p&gt;
  </code></pre>
  <p>Such a bookmark is not listed by iterating in any of the paragraphs bookmarkStart elements, so that the following code will not list this bookmark:</p>
  <pre><code>XWPFDocument document = ...
  for (XWPFParagraph paragraph : document.getParagraphs())
  {
      for(CTBookmark bookmark : paragraph.getCTP().getBookmarkStartList())
          System.out.println(bookmark.getName());
      {
  }
  </code></pre>
  <p>Question is how to discover that sort of bookmark that is placed outside of a paragraph?</p>