XmlWriter.WriteNode (XPathNavigator, Boolean)
Imports System
Imports System.IO
Imports System.Xml
Imports System.Xml.XPath
Module Module1
Sub Main()
Dim doc As XPathDocument = New XPathDocument("books.xml")
Dim nav As XPathNavigator = doc.CreateNavigator()
Dim writer As XmlWriter = XmlWriter.Create(Console.Out)
writer.WriteStartElement("myBooks")
nav.MoveToChild("bookstore", "")
nav.MoveToChild("book", "")
writer.WriteNode(nav, False)
writer.WriteEndElement()
writer.Close()
End Sub
End Module
Related examples in the same category