private void btnXMLReplaceAttribute_Click(object sender, EventArgs e) { XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(@"..\\..\\Product.xml"); XmlNodeList xmlNodeList = xmlDocument.GetElementsByTagName("LABEL"); foreach (XmlNode item in xmlNodeList) { XmlAttributeCollection xmlAttributeCollection = item.Attributes; XmlNode xml = xmlAttributeCollection.GetNamedItem("value"); //xml.InnerText = (int.Parse(xml.InnerText) - 1).ToString(); xml.InnerText = "NEW String"; } xmlDocument.Save(@"..\\..\\ProductNew.xml"); }