Adding code that catches malformed XML.