title: Insert a line break inside a paragraph in XWPFDocument
body: <p>I am writing values into a word template using apache poi 3.8. I replace specific strings in a word file (keys) with required values, e.g. word document has a paragraph containing key %Entry1%, and I want to replace it with "Entry text line1 \nnew line". All replaced keys and values are stored in a Map in my realisation.</p>
  
  <pre><code>Map&lt;String, String&gt; replacedElementsMap;
  </code></pre>
  
  <p>The code for HWPFDocument is:</p>
  
  <pre><code>Range range = document.getRange();
  for(Map.Entry&lt;String, String&gt; entry : replacedElementsMap.entrySet()) {
              range.replaceText(entry.getKey(), entry.getValue());
  }
  </code></pre>
  
  <p>This code works fine, I just have to put \n in the entry string for a line break. However I can't find similiar method for XWPFDocument. My current code for XWPFDocument is:  </p>
  
  <pre><code>List&lt;XWPFParagraph&gt; xwpfParagraphs = document.getParagraphs();
  for(XWPFParagraph xwpfParagraph : xwpfParagraphs) {
              List&lt;XWPFRun&gt; xwpfRuns = xwpfParagraph.getRuns();
              for(XWPFRun xwpfRun : xwpfRuns) {
                  String xwpfRunText = xwpfRun.getText(xwpfRun.getTextPosition());
                  for(Map.Entry&lt;String, String&gt; entry : replacedElementsMap.entrySet()) {
                      if (xwpfRunText != null &amp;&amp; xwpfRunText.contains(entry.getKey())) {
                          xwpfRunText = xwpfRunText.replaceAll(entry.getKey(), entry.getValue());
                      }
                  }
                  xwpfRun.setText(xwpfRunText, 0);
              }
          }
  </code></pre>
  
  <p>Now the "\n"-string doesn't result in the carriage return, and if I use  <code>xwpfRun.addCarriageReturn();</code> I just get a line break after the paragraph. How should I create new lines in xwpf correctly?</p>