I have an XML file and some of the sections in the file do not contain any data. Before I send this XML to a webservice, I would like to know if there's any way to get rid of the empty sections.

For example:
PHP Code:
<Root>
<
MainContainer>
<
SectionOne>
 <
Collection/>
</
SectionOne>
<
SectionTwo>
<
Collection>
   <
ItemOne>Has Value</ItemOne>
</
Collection>
</
SectionTwo>
</
MainContainer>
</
Root

In the example above, I would want SectionOne to completely disappear and then the XML cleaned up will look like the one below.

PHP Code:
<Root>
<
MainContainer>
<
SectionTwo>
<
Collection>
   <
ItemOne>Has Value</ItemOne>
</
Collection>
</
SectionTwo>
</
MainContainer>
</
Root

How can I do this ? This is an example. There are several sections in the XML file and they are not named with the word section in there.
I need to do this on more than 100 K files to shrink their size.


DeanMc used to have an XAML formatter online. Anybody know what happened to it?