I have an xml of following format.
book 1
author 1
XmlDocument doc = new XmlDocument();
doc.Load("file.xml");
XmlElement foo = doc.CreateElement("foo");
XmlElement bar = doc.CreateElement("bar");
bar.InnerText = "whatever";
foo.AppendChild(bar);
doc.DocumentElement.AppendChild(foo);
doc.Save("file.xml");
see Martin Honnen Post at: Adding a new Node to existing XML document