You don't have 1 XML document, as it is you have a number of them, in a single file. You coult insert stream delimiters between those documents to get XML::Parser to unserstand they they should be treated as separate XML documents.
You could also wrap them all in a root tag, either in the main file, or by using an entity that includes it, see Re: XML log files.
Oh, and I found a FAQ about it in the XML::Twig FAQ :--)
You really have to understand that at this point you don't have XML. If it doesn't parse, then it is not XML. If you want to have XML you have to get your data to be XML, or to use the mildly hacky stream delimiter option.
|