static string ScrubXml(string text)
{
// Remove all instances of xml declaration:
//
// <?xml version="1.0" encoding="utf-8"?>
//
// as this may be in weird places!
// Regex should be: (\\Q<?\\E).*?(\\Q?>\\E)
//
var result = XmlRegex.Replace(text, "");
try
{
result = RemoveAllNamespaces(XElement.Parse(result)).ToString();
}
catch(Exception ex)
{
Dev2Logger.Log.Error("Scrubber", ex);
}
return result;
}