title: PHP createTextNode with br tag
body: <p>This is far simpler than I'm making it, I'm sure.
  I want to create the code:</p>
  
  <pre><code>text&lt;br/&gt;
  </code></pre>
  
  <p>However you cannot use DOMNode::createElement to add node text to a br as you would with a paragraph:</p>
  
  <pre><code>$doc-&gt;createElement('br',$para-&gt;nodeValue)
  </code></pre>
  
  <p>I've also tried creating a text node then adding the break to it. This doesn't work!:</p>
  
  <pre><code>$newelement = $doc-&gt;createTextNode($para-&gt;nodeValue);
  $newelement-&gt;appendChild($doc-&gt;createElement('br'));
  $new_node = $para-&gt;parentNode-&gt;replaceChild($newelement, $oldelement);
  </code></pre>
  
  <p>Can anyone advise on the correct method for adding a line with a br tag after it?</p>