Dear Log,
Thought for the day:
Do not generate XML by hand, nor just by doing
print "<thing foo='$bar' />";
Use XML::Generator!
Last time I checked that module had a few issues, notably with encoding and with not always producing correct XML. Of course, this might have changed, but it hasn't been updated in a while so I'd be wary.
There's a growing variety of ways of producing XML without writing it. My current favourite is XML::Generator::PerlData. Simple, efficient, perlish (in a good way): what more can one ask?