I found this when I was browsing for a similar function myself, so I'm sorry for arriving late to the party! :-) I'm just posting this in case anyone else is looking for a similar answer.
There are a couple of CPAN modules which appear to do a similar job. Specifically XML::Hash and XML::Hash::LX.
Both modules predate the 2012 date of the question by a couple of years.
In reply to Re: comments on xml 2 hash 2 xml using libXML
by space_monk
in thread comments on xml 2 hash 2 xml using libXML
by irishBatman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |