patch malformed xml