public void RemoveAttribute(string xPath,string name) { var element = GetXElement(xPath); if (element == null) return; var attribute = element.Attribute(name); if (attribute == null) return; attribute.Remove(); }