Make invalid XML handling more robust, verbose