title: How to Detect if an XML Element is Empty using DOMDocument in PHP?
body: <p>If I delete an element inside an element, and if its the last element, then the parent element gets shortened to an empty element.</p>
  
  <p>Example:</p>
  
  <p>Start:
  <code>&lt;element&gt;&lt;child1&gt;Inner HTML&lt;/child1&gt;&lt;child2&gt;Inner HTML&lt;/child2&gt;&lt;/element&gt;</code></p>
  
  <p>I delete Child2 and I get:
  <code>&lt;element&gt;&lt;child1&gt;Inner HTML&lt;/child1&gt;&lt;/element&gt;</code></p>
  
  <p>I delete Child1 and I get:
  <code>&lt;element/&gt;</code></p>
  
  <p>Now I want that to not happen or at least a way to detect if the element is empty so I can replace it.
  How can I do that using DOMDocument in PHP.</p>
  
  <p>Thanks...</p>