in reply to XML::TreeBuilder invalid token problem

To put it simply, the uri wasn't XML-escaped before being placed into the XML, resulting in invalid XML. & should have been transformed to &.