in reply to How to format this xml output?
Ideally, as glasswalk3r said, you'd provide us more information about the XML with which you want to work and the database you are using. You may also wish to consider, however, whether XML::Simple is adequate for your needs.
I, and others here, really like XML::Twig; a great deal of information is available on The XML::Twig Homepage.
Stepping up from XML::Simple to XML::LibXML, appropriately enough, discusses migrating from XML::Simple to XML::LibXML.
The point is, make sure the module is a good fit for your requirements before becoming locked in.