title: Is there a way to force XML to include closing tags when using toString() or toXMLString()?
body: <p>When I convert XML to a string it converts empty nodes to a singleton leaf. Is there a way to request that it use closing tags instead of singletons? </p>
  
  <p>For example, here is pseudo ActionScript3:  </p>
  
  <pre><code>var xml:XML = new XML("&lt;XML&gt;&lt;NODE/&gt;&lt;/XML&gt;");
  
  var output:String = xml.toXMLString();
  </code></pre>
  
  <p>trace(output);</p>
  
  <pre><code>&lt;XML&gt;
     &lt;NODE/&gt;
  &lt;/XML&gt;
  </code></pre>
  
  <p>What I want is: </p>
  
  <pre><code>&lt;XML&gt;
    &lt;NODE&gt;&lt;/NODE&gt;
  &lt;/XML&gt;
  </code></pre>
  
  <p>PS I'm using AS3 and Flash Player 12 which uses E4X. </p>
  
  <p><strong>Back Story:</strong><br>
  I'm generating HTML page and then running it through an XML validator and I would like it to be valid and it has problems with things like <code>&lt;link&gt;</code> that in boiler plate they don't close the tag, no "/". There are other cases I have <code>div</code> that when exporting to XML string the XML class rewrites those as <code>&lt;div/&gt;</code> which breaks the HTML page. Sometimes, the nodes will be empty. If I put a space or value in the node it will change the layout of the page. </p>
  
  <p>So basically, there are a few reasons where keeping empty nodes from being written as singletons would be beneficial. </p>