Once upon a time I started a project using
XML::Simple, but it went so complicated to keep output consistent that I ended using
XML::LibXML, and all is fine and great ever since.
XML::Simple is deceptive, unless you stick to really very trivial XML usage.