title: SimpleXmlElement->addAttribute() doesn't allow empty strings
body: <h2>Description:</h2>
  
  <p>A call like addAttribute("attrname", "") results in
  "PHP Warning:  SimpleXMLElement::addAttribute(): Attribute name and value are required". In addition to the warning, the attribute is discarded.</p>
  
  <h2>Reproduce code:</h2>
  
  <pre><code>&lt;?php
  $xml = new SimpleXmlElement("&lt;img&gt;&lt;/img&gt;");
  $xml-&gt;addAttribute("src", "foo");
  $xml-&gt;addAttribute("alt", "");
  echo $xml-&gt;asXML()."\n";
  ?&gt;
  </code></pre>
  
  <h2>Expected result:</h2>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;img src="foo" alt=""/&gt;
  </code></pre>
  
  <h2>Actual result:</h2>
  
  <pre><code>PHP Warning:  SimpleXMLElement::addAttribute(): Attribute name and value are required in [...]/test.php on line 4
  &lt;?xml version="1.0"?&gt;
  &lt;img src="foo"/&gt;
  </code></pre>
  
  <p>this problem exists in PHP 5.2.1, but in PHP5.3.5 it works as I expect, but I can't change my php version(for some reason). Is there any way to solve this?</p>