Add error handling for bad XML.