a simpler way is to use classes in System.Xml    string sFile = "your.xml";
    XmlDocument doc = new XmlDocument();
    //doc.LoadXml("<DBRoot/>");
    doc.Load(sFile);    XmlNode root = doc.DocumentElement;    //Create a new node.
    XmlElement elem = doc.CreateElement("DB");
    XmlElement elem2 = doc.CreateElement("name");
    elem2.InnerText = "abc"; 
   XmlElement elem3 = doc.CreateElement("sid");
    elem3.InnerText = "acccc";    elem.AppendChild(elem2);
    elem.AppendChild(elem3);
    //Add the node to the document.
    root.AppendChild(elem);
    doc.Save(sFile);also see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxmlnodeclassappendchildtopic.asp