title: Insert new child node in an existing XML
body: <p>Good day everyone. I would like to ask for help with my code. I have here an XML document containing the following.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
      &lt;TechnicalReport&gt;
        &lt;Data quantity = "2" description ="myDesc" findings = "none" actiontaken = "none" /&gt;
      &lt;/TechnicalReport&gt;
  </code></pre>
  
  <p>What I would like to do here is to add another child node inside the . I have searched for so many websites about my problem but to no avail. For example, I will add another node, say:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
      &lt;TechnicalReport&gt;
        &lt;Data quantity = "2" description ="myDesc" findings = "none" actiontaken = "none" /&gt;
        &lt;Data quantity = "3" description ="myDesc2" findings = "none2" actiontaken = "none3" /&gt;
      &lt;/TechnicalReport&gt;
  </code></pre>
  
  <p>I have successfully compiled and loaded the XML file into a Repeater control using an XMLDataSource, but when I do an insert from my form, the Repeater control does not update its contents, and even my XML file also does not update. </p>
  
  <p>Here's my C# code:</p>
  
  <pre><code>public void AddNewRecord()
  {
      //Load XML Schema
      XmlDocument originalXml = new XmlDocument();
      originalXml.Load(Server.MapPath("xmlTechReportDetails.xml"));
  
      //Create the node name Technical Report
      XmlNode TechReport = originalXml.SelectSingleNode("TechnicalReport");
      XmlNode Data = originalXml.CreateNode(XmlNodeType.Element, "Data", null);
  
      //Insert quantity
      XmlAttribute quantity = originalXml.CreateAttribute("quantity");
      quantity.Value = txtQty.Text;
  
      //Insert description
      XmlAttribute description = originalXml.CreateAttribute("description");
      description.Value = txtDescription.Text;
  
      //Insert findings
      XmlAttribute findings = originalXml.CreateAttribute("findings");
      findings.Value = txtFindings.Text;
  
      //Insert actions taken.
      XmlAttribute actionTaken = originalXml.CreateAttribute("actiontaken");
      actionTaken.Value = txtAction.Text;
  
      Data.Attributes.Append(quantity);
      Data.Attributes.Append(description);
      Data.Attributes.Append(findings);
      Data.Attributes.Append(actionTaken);
  
      TechReport.AppendChild(Data);
  }
  </code></pre>
  
  <p>Please help. </p>