Try and improve libxml error handling.