title: How to extract paragraphs instead of whole texts only for XWPFWordExtractor (POI Library) Java
body: <p>I know the following code could extract whole texts of the docx document, however, I need to extract paragraph instead. Is there are possible way??</p>
  <pre><code>public static String extractText(InputStream in) throws Exception {
  
      JOptionPane.showMessageDialog(null, &quot;Start extracting docx&quot;);
      XWPFDocument doc = new XWPFDocument(in);
      XWPFWordExtractor ex = new XWPFWordExtractor(doc);
      String text = ex.getText();
      return text;
  }
  
  </code></pre>
  <p>Any helps would much appreciated. I need this so urgently.</p>