XML C#

using System;
using System.IO;
using System.Xml;
using System.Xml.XPath;
public class Sample
{
    public static void Main()
    {
        XPathDocument doc = new XPathDocument("books.xml");
        XPathNavigator nav = doc.CreateNavigator();
        XmlWriter writer = XmlWriter.Create(Console.Out);
        writer.WriteStartElement("myBooks");
        nav.MoveToChild("bookstore", "");
        nav.MoveToChild("book", "");
        writer.WriteNode(nav, false);
        writer.WriteEndElement();
        writer.Close();
    }
}