public static void WriteAttributeStringSafe(this XmlWriter xml, string key, string value){ xml.WriteAttributeString(key, RemoveInvalidXmlChars(value)); }