in reply to XML::TreeBuilder invalid token problem

"n&%2339" is not valid XML. An ampersand can only be used to refer to entities, like & and > and then only a few (non-numeric) entities are predefined.

Update: I'm not sure if there is a way to work around invalid XML using XML::TreeBuilder. Conforming XML parsers are required to throw an exception when encountering invalid XML. In other words, XML parsers should parse valid XML and reject invalid XML with no way of working around it.

In your case, the URL should have been escaped using n&%2339