How to extract paragraphs instead of whole texts only for XWPFWordExtractor (POI Library) Java
<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>

<p>public static String extractText(InputStream in) throws Exception {</p>

<pre><code>    JOptionPane.showMessageDialog(null, "Start extracting docx");
   XWPFDocument doc = new XWPFDocument(in);
    XWPFWordExtractor ex = new XWPFWordExtractor(doc);
    String text = ex.getText();
    return text;
</code></pre>

<p>}</p>

<p>Any helps would much appreciated. I need this so urgently. </p>
