title: How to insert a line break in createTextNode
body: <p>For a little program that outputs some XML Code in a p element I need to have some line breaks in the output.
  In the last week I tried a lot of things like document.createElement("br"); or inserting escape character \n or unicode whitespace-character \u000A but nothing worked.</p>
  
  <p>My output now:</p>
  
  <pre><code>&lt;viva:form rdf:parseType="Resource"&gt; &lt;viva:title&gt;55&lt;/viva:title&gt;
  </code></pre>
  
  <p>I need it that way:</p>
  
  <pre><code>&lt;viva:form rdf:parseType="Resource"&gt;
    &lt;viva:title&gt;55&lt;/viva:title&gt;
  </code></pre>
  
  <p>My code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var vivaTitle;
  function elementeAbrufen() {
      vivaTitle = document.getElementById("inputVivaTitle").value;
      var p = document.createElement("p");
      var t = document.createTextNode(headErzeugen());
      p.appendChild(t);
      document.body.appendChild(p)
  }
  
  function headErzeugen() {
    // insert unicode lf
      var lf = "\u000A";
      var xmlHeadStruktur = "&lt;viva:form rdf:parseType=\"Resource\"&gt;";
      var xmlHeadTitle = "&lt;viva:title&gt;" + vivaTitle + "&lt;/viva:title&gt;";
      return xmlHeadStruktur + lf + xmlHeadTitle
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;p id="vivaTitle" title=""&gt;viva:title: 
          &lt;input type="text" id="inputVivaTitle" value=""&gt;
      &lt;button onclick="elementeAbrufen()"&gt;send&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I'm thankfull for every help.
  Cheers, Didier</p>