title: Using XMLdocument to add node
body: <p>In following XML document , I need to append a node</p>
  
  <pre><code>&lt;DASHBOARD&gt;
    &lt;ANNOUNCEMENT&gt;
      &lt;DISPLAYTEXT&gt;testin one&lt;/DISPLAYTEXT&gt;
    &lt;/ANNOUNCEMENT&gt;
    &lt;ADMINLINKS&gt;
      &lt;LINK NAME="Google"&gt;"http:\\www.google.com"&lt;/LINK&gt;
    &lt;/ADMINLINKS&gt;
    &lt;GENLINKS&gt;
      &lt;LINK NAME="Clearquest"&gt;"http://clearquest.com/cqweb/"&lt;/LINK&gt;
      &lt;LINK NAME="Google"&gt;http://www.google.com&lt;/LINK&gt;
    &lt;/GENLINKS&gt;
  &lt;/DASHBOARD&gt;
  </code></pre>
  
  <p>The issue is I need to add a new node named link under adminlinks and genlinks simultaneously. Here is the piece of code</p>
  
  <pre><code>XmlDocument xmldoc = new XmlDocument();
  xmldoc.Load("DashBoard.xml");
  
  XmlNode NodeGen = xmldoc.SelectSingleNode("DASHBOARD/GENLINKS");
  XmlNode NodeAdmin = xmldoc.SelectSingleNode("DASHBOARD/ADMINLINKS");
  
  XmlNode newLink = xmldoc.CreateNode(XmlNodeType.Element, "LINK", null);
  XmlAttribute xa = xmldoc.CreateAttribute("NAME");
  xa.Value = LinkName;
  newLink.InnerText = Link;
  newLink.Attributes.Append(xa);
  
  NodeGen.AppendChild(newLink);
  NodeAdmin.AppendChild(newLink);
  
  xmldoc.Save("DashBoard.xml");
  </code></pre>
  
  <p>This is adding the link under adminlinks but not under genlinks.</p>