title: How to change textValue of node without removing its childNodes
body: <p>Imagine this HTML : </p>
  
  <pre><code>&lt;html&gt;
        &lt;head&gt;&lt;title&gt;Nice page&lt;/title&gt;&lt;/head&gt;
        &lt;body&gt;Hello World &lt;a href=http://google.com&gt;This is a link&lt;/a&gt;
              &lt;br /&gt;
              &lt;a href=http://www.google.com&gt; this also
                  &lt;img src=wrong.image&gt; and here
              &lt;/a&gt;
       &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I try to put all the text of my links in capital letters, it erases the img tag of my link tags.</p>
  
  <pre><code>&lt;html&gt;
         &lt;head&gt;&lt;title&gt;Nice page&lt;/title&gt;&lt;/head&gt;
         &lt;body&gt;Hello World &lt;a href=http://google.com&gt;THIS IS A LINK&lt;/a&gt;
              &lt;br /&gt;
              &lt;a href=http://www.google.com&gt; THIS ALSO AND HERE&lt;/a&gt;
        &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is the PHP I use : </p>
  
  <pre><code>libxml_use_internal_errors(true);
  $doc = new DOMDocument();
  $doc-&gt;loadHTMLFile("index.html");
  $elements = $doc-&gt;getElementsByTagName("a");
  foreach($elements as $elem)
  {
      $elem-&gt;nodeValue = strtoupper($elem-&gt;nodeValue);
  }
  echo $doc-&gt;saveHTML();
  </code></pre>
  
  <p>How can I preserve the children?</p>