Without seeing any data (hint hint), giving you solid advice
is kind of hard. My first approach would be to use
DBD::CSV (again, need more info ... howare you
storing stuff inside the flat file) with
XML::Generator::DBI. Or how about simply
XML::CSV? Here are a couple of links for you: