I am looking for the clean, elegant and smart solution to remove namespacees from all XML elements? How would function to do that look like?
Defined interface:
You can do that using Linq:
public static string RemoveAllNamespaces(string xmlDocument) { var xml = XElement.Parse(xmlDocument); xml.Descendants().Select(o => o.Name = o.Name.LocalName).ToArray(); return xml.ToString(); }