Extensions.XPathEvaluate evaluates an XPath expression.
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim d As XDocument = _
<?xml version='1.0'?>
<root a='value'/>
Dim att As IEnumerable = CType(d.XPathEvaluate("/root/@a"), IEnumerable)
Console.WriteLine(att.Cast(Of XAttribute)().FirstOrDefault())
End Sub
End Class