title: Remove Empty tags in XML using plain python without lxml library
body: <p>My use case is to remove empty tags in an XML using simple plain python 2.7. No extra lxml library is available.</p>
  
  <p>Sample Code:</p>
  
  <pre><code>&lt;ArML&gt;
      &lt;MsgHeader&gt;
          &lt;Deal&gt;
              &lt;Attribute&gt;
                  &lt;Name&gt;First&lt;/Name&gt;
                  &lt;Value&gt;10&lt;/Value&gt;
              &lt;/Attribute&gt;
              &lt;Attribute&gt;
                  &lt;Name&gt;Second&lt;/Name&gt;
                  &lt;Value&gt;&lt;/Value&gt;
              &lt;/Attribute&gt;
              &lt;Attribute&gt;
                  &lt;Name&gt;Third&lt;/Name&gt;
                  &lt;Value&gt;&lt;/Value&gt;
              &lt;/Attribute&gt;
              &lt;Attribute&gt;
                  &lt;Name&gt;Fourth&lt;/Name&gt;
                  &lt;Value&gt;40&lt;/Value&gt;
              &lt;/Attribute&gt;
          &lt;/Deal&gt;
      &lt;/MsgHeader&gt;
      &lt;MsgHeader&gt;
          &lt;Deal&gt;
              &lt;Attribute&gt;
                  &lt;Name&gt;Fifth&lt;/Name&gt;
                  &lt;Value&gt;10&lt;/Value&gt;
              &lt;/Attribute&gt;
              &lt;Attribute&gt;
                  &lt;Name&gt;Sixth&lt;/Name&gt;
                  &lt;Value&gt;&lt;/Value&gt;
              &lt;/Attribute&gt;
              &lt;Attribute&gt;
                  &lt;Name&gt;Seventh&lt;/Name&gt;
                  &lt;Value&gt;70&lt;/Value&gt;
              &lt;/Attribute&gt;
              &lt;Attribute&gt;
                  &lt;Name&gt;Eight&lt;/Name&gt;
                  &lt;Value&gt;&lt;/Value&gt;
              &lt;/Attribute&gt;
          &lt;/Deal&gt;
      &lt;/MsgHeader&gt;
  &lt;/ArML&gt;
  </code></pre>
  
  <p>I am using the below code, but it is not working properly for all the empty tags. Please help.</p>
  
  <pre><code>for elem in root.iter('MsgHeader'):
  Deal = root.find("./MsgHeader/Deal")
  empty = root.find("./MsgHeader/Deal/Attribute/[Value='']")
  Deal.remove(empty)
  print(ET.tostring(root, encoding='utf8').decode('utf8'))
  </code></pre>