title: Make an exact copy of a paragraph including all contents and properties?
body: <p>I'm trying to do an exact copy of one paragraph into another (I'm copying a template over to a new document for word-replacement). I'm doing this for paragraphs within a table cell, but I don't believe that is significant. The following code nearly works:</p>
  
  <pre><code>for (XWPFParagraph p : cell.getParagraphs()) {
      XWPFParagraph np = newCell.addParagraph();
      np.getCTP().set(p.getCTP());
  }
  </code></pre>
  
  <p>The problem is, while <code>np.getCTP().xmlText().equals(p.getCTP().xmlTest()</code> is true, <code>np.getText()</code> is blank while <code>p.getText()</code> has the contents of the paragraph. It seems like my paragraph doesn't know about the underlying change I made to the XML. This results in my output document containing the placeholder text because my code can't seem to see the contents of the paragraph any more in order to perform the replacement.</p>
  
  <p>How can I make a perfect copy of a paragraph including all contents and properties?</p>