I have a xml file and wanted to update and save the value of target load with C# code. My code is as below which is trying to xml shown below -
var fileName = textBox1.Text;
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
xmlDoc.Load(fileName);
xmlDoc.SelectSingleNode("factoryTest/targetLoad").InnerText = "80";
xmlDoc.Save(fileName);
<?xml version="1.0" encoding="utf-8"?>
<factoryTest xmlns="urn:gcpm">
<targetLoad>90</targetLoad>
<isAccepted>true</isAccepted>
<isCertified>true</isCertified>
<isAtRatingConditions>true</isAtRatingConditions>
<supervisorName>Eric Larson</supervisorName>
</factoryTest>