// remove xml invalid chars plus additioan replace for space and &
static string RemoveInvalidXmlChars(string text)
{
var validXmlChars = text.Where(ch => XmlConvert.IsXmlChar(ch)).ToArray();
return new string(validXmlChars).Replace(" ","").Replace("&","");
}