It has been a great challenge for me to code XSLT to bring my desired output ..
Here is my XML input .. which I am testing on ..
<aaa id="1">
<bbb id="2">text1</bbb>
<ccc>text2</ccc>
<ddd id="3">
<eee att="4d">text3</eee>
<fff>
<ggg att="3d">
<yyy>text4</yyy>
<iii attr="jj"/>
</ggg>
</fff>
<sss>
<ttt info="Y">
<nnn delete="N">
<mmm>text5</mmm>
</nnn>
</ttt>
</sss>
</ddd>
</aaa>
The desired output :
<root>
<aaa id="1"/>
<bbb id="2">text1</bbb>
<ccc>text2</ccc>
<ddd id="3"/>
<eee att="4d">text3</eee>
<fff/>
<ggg att="3d"/>
<yyy>text4</yyy>
<iii attr="jj"/>
<sss/>
<ttt info="Y"/>
<nnn delete="N"/>
<mmm>text5</mmm>
</root>
I am not able to write generalised code .. I mean, My code must be able to give similar output for different XML file with different tag names ..