public static void UpdateAttribute(this XmlElement xmlElement, string attributeName, string newValue) { XmlAttribute attrTemp = null; attrTemp = (XmlAttribute)xmlElement.Attributes.GetNamedItem(attributeName); attrTemp.InnerText = newValue; }