I just commited a patch to the 5.1 branch of PHP, which allows you to parse not well-formed XML documents and adds the missing elements, eg. missing closing tags.
This can be very useful, if you have to parse XML documents, on which you don't have any influence. Of course libxml2 ...