http://www.perlmonks.org?node_id=606563

valavanp has asked for the wisdom of the Perl Monks concerning the following question:

i have a xml file like below:
<doc.body> <head n="1">Introduction</head> <para>para 1</para> <para>para 2</para> <head n="2">Individual</head> <para>para 1</para> <para>para 2: <list listtype="bull"> <item>item 1</item> <item>2</item> </para> </doc.body>
The output which i want is
TX <h3>INTRODUCTION</h3> TX para 1 TX para 2 TX <h3>Individual</h3> TX para 1 TX para 2 TX <ol><li>item1</li><li>2</ol>
Can anyone suggest how to approach the above problem. i used XML::Twig module but couldn't get the solution. You can see in my post named as reading from XML files. Thanks all for your suggestions.