Here is the C # version that will work
XDocument d = XDocument.Load(xmlFileName);
var sum = d.Root.Descendants("Item").Where(i => i.Element("ItemPrice")
.Element("Component")
.Element("Type")
.Value == "Principal")
.Sum(i => Convert.ToDouble(i.Element("ItemPrice")
.Element("Component")
.Element("Amount")
.Value));
, , http://converter.telerik.com/, vb.net .
.
Dim d As XDocument = XDocument.Load(xmlFileName)
Dim sum = d.Root.Descendants("Item").Where(Function(i) i.Element("ItemPrice").Element("Component").Element("Type").Value = "Principal").Sum(Function(i) Convert.ToDouble(i.Element("ItemPrice").Element("Component").Element("Amount").Value))
EDIT:
Convert.ToInt64() Convert.ToDouble().