title: How to copy a paragraph of .docx to another .docx with Java and retain the style
body: <p>I am trying to copy the content from a particular paragraph in a .docx to another empty .docx .the problem i have is that the style,bullets,numbering etc from the source.docx is not retained in the destination .docx.Here is my code</p>
  
  <p>can anyone please tell me what are the changes to be added to the above code?
  Thanks in Advance!!</p>
  
  <pre><code>public class WordFinal {
  
          public static void main(String[] args) throws IOException, XmlException {
  
          XWPFDocument doc = new XWPFDocument(new FileInputStream("source.docx"));
  
          XWPFDocument destDoc =new XWPFDocument(); 
  
          OutputStream out = new FileOutputStream("Destination.docx"); 
  
          XWPFParagraph pr =doc.getParagraphs()[1];
  
          String copy=pr.getText();
  
          XWPFParagraph paragraphOne = destDoc.createParagraph(); 
  
          XWPFRun paragraphOneRunOne = paragraphOne.createRun();
  
          paragraphOneRunOne.setText(copy);
  
          destDoc.write(out);
  
           }
               }
  </code></pre>