Problem now is that the real xml I'm going to read is slightly different...
Indeed, and alas, in that case the readXMLfragment is also not able to help you out there.
If it was me, i would take a moment to think on what it is exactly that you wish to accomplish as there could be several approaches.
First, it seems to me that your file is a log file. Each entry in that log is situated on a single line. Part of that line contains xml.
What is it that you wish to accomplish with the data stored in the xml part (and what of the other information for that matter) ?
Is your goal to end up with a single xml document that has each entry listed, so that you are able to query the xml document for those data that you need ? Or is it that the only reason to use xml parsing is because your data is stored in xml format, and that you do not care about that at all as long as you are able to extract the parts that you are interested in ?
In case the former, you could perhaps use a stringlist for line parsing, use extractword (and related function) to break apart the line and store that into an xml document. In that case the xml tags would have to be removed/skipped/ignored/replaced.
In case the latter then using a regular expressions might perhaps be more helpful, as suggested by user Cyrax (you could use regex for the former as well, but nothing a simple search and replace or extractword couldn't fix for you).
Secondly, there is use of non compliant xml. You could perhaps solve that with using a on the fly xml parser (react to events) (perhaps better known as sax), but you have to take into account that in the end using a sax parser could perhaps not solve the reading/parsing for you either.
Another possible approach could be to use benibela's
internet toolsI'm too inexperienced with xml (and mentioned approaches) to be able to give you a better advice atm. I was unable to solve it in a more easier manner, but perhaps other readers have an idea or two.