in reply to Forcing XML to validate

It seems that you have a pattern to what is wrong with your XML. I'm not good enough at XML to be able to look at your error and visualize the bustedness, but I'd imagine that you could modify your data coming in so that it is compliant before passing it to the parser. For instance, if you have something like this...
< foo>stuff< /foo>
..and that turns out to be not valid because of the space after the '<', you could do something like:
$xml =~ s/<\s+/</g
However, as I said, this is just a guess since I haven't seen what kind of invalid XML you actually have.

thor