title: What to do if nodeValue contains only a space and nothing more
body: <p>Let's assume I need to copy this HTML into a variable (server-side, thus PHP):</p>
  
  <pre><code>&lt;text&gt;
    &lt;i&gt;The text
      &lt;inserted&gt; &lt;/inserted&gt;
      &lt;inserted&gt;has changed&lt;/inserted&gt;
    &lt;/i&gt;
  &lt;/text&gt;
  </code></pre>
  
  <p>So I use this kind of code:</p>
  
  <pre><code>$dom = new DOMDocument();
  $dom-&gt;loadHTML($html); # HTML from above
  foreach ($x-&gt;query("//text") as $node) 
  {
      $the_html .= $node-&gt;C14N()
  }
  </code></pre>
  
  <p>(<a href="http://www.php.net/domnode.c14n" rel="nofollow"><code>DOMNode::C14N()</code></a> is a super find for me)</p>
  
  <p>So, everything is fine, except that the result is like this:</p>
  
  <pre><code> &lt;text&gt;
    &lt;i&gt;The text
      &lt;inserted&gt;&lt;/inserted&gt;
      &lt;inserted&gt;has changed&lt;/inserted&gt;
    &lt;/i&gt;
  &lt;/text&gt;
  </code></pre>
  
  <p>The space inside first <em><code>&lt;inserted&gt;</code></em> is gone! Debugging like this:</p>
  
  <pre><code>echo 'damn' . $node-&gt;firstChild-&gt;firstChild-&gt;nodeValue . 'it';
  </code></pre>
  
  <p>also returns 'damnit'.</p>
  
  <p>Is there a way to preserve the space? (I tried with <a href="http://php.net/class.domdocument#domdocument.props.preservewhitespace" rel="nofollow"><code>DOMDocument::$preserveWhiteSpace</code></a> but it is not the solution apparently.)</p>
  
  <p>Or is it impossible, and I should change my approach?</p>