public static void RemoveAttribute(XmlElement element, string attributeName) { XmlAttribute attribute = null; attribute = (XmlAttribute)element.Attributes.GetNamedItem(attributeName); element.Attributes.Remove(attribute); }