in reply to XML parsing errors - finding them

It might be worth trying out the XML::Parser module and parsing your content with the ErrorContext option set. That should give you some idea.