title: Rationale behind SimpleXMLElement's handling of text values in addChild and addAttribute
body: <p>Isn't that an inconsistent behavior? (PHP 5.2.6)</p>
  
  <pre><code>&lt;?php
  
  $a = new SimpleXMLElement('&lt;a/&gt;');
  
  $a-&gt;addAttribute('b', 'One &amp; Two');
  //$a-&gt;addChild('c', 'Three &amp; Four'); -- results in "unterminated entity reference" warning!
  $a-&gt;addChild('c', 'Three &amp;amp; Four');
  $a-&gt;d = 'Five &amp; Six';
  
  print($a-&gt;asXML());
  </code></pre>
  
  <p>Renders:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;a b="One &amp;amp; Two"&gt;
      &lt;c&gt;Three &amp;amp; Four&lt;/c&gt;
      &lt;d&gt;Five &amp;amp; Six&lt;/d&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>At bugs.php.net they reject all the submissions about that, saying it's a feature. Why could that possibly be? BTW, there's nothing in the docs about that discrepancy of escaping text values by SimpleXMLElement.</p>
  
  <p>Can anyone convince me it's the best API design decision possible?</p>