I can't use XML::Simple because it is not preserving attributes and elements.
Also for my application, I have to preserve the order and structure of the XML that I am creating.
Regarding my requirement, I should be able to parse the XML file going step by step from top to bottom.
While parsing I should be able to edit some of the tags and so on. When I finish I should be able to create an XML which is similar to the original one in structure.