Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim document As XPathDocument = New XPathDocument("books.xml")
Dim navigator As XPathNavigator = document.CreateNavigator()
Dim nodes As XPathNodeIterator = navigator.Select("//book")
Dim query As XPathExpression = nodes.Current.Compile("sum(descendant::price)")
Dim total As Double = CType(navigator.Evaluate(query, nodes), Double)
Console.WriteLine(total.ToString())
End Sub
End Class