The API for removing attributes is much richer than that for removing other nodes. This is due to the ability to remove nodes through methods on the XmlAttributeCollection class as well as methods on the XmlElement class.
The XmlAttributeCollection class provides three methods for removing an XmlAttribute: Remove, RemoveAt, and RemoveAll. The Remove method removes a single specified attribute from the attribute collection. The RemoveAt method removes a single attribute corresponding to the specified index from the collection. The RemoveAll method removes all of the attributes in the collection. Listing 11.28 demonstrates how to use each method.
C# XmlDocument doc = new XmlDocument(); ...