Just for reference, XML::Simple is not designed for arbitrary XML, but rather a simple interface for a simple interface for XML. If you have something that XML::Simple doesn't handle, it's time to move to real parsers, such as XML::Parser or XML::LibXML.