I'm not sure if you're aware of the pointless processing occurring at these four lines. The data assigned to $cat are immediately lost because this variable immediately goes out of scope. This may not be a typo, as I suggested, but it is definitely an issue you should address.
The problem you describe with XML::Simple indicates non-conformance with the published XML Specification. If you are absolutely certain about this, consider advising the module's author(s).
Regards,
PN5
In reply to Re^3: not well-formed (invalid token)
by Prior Nacre V
in thread not well-formed (invalid token)
by Maxim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |