XElement.HasAttributes tells whether this element as at least one attribute.
Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim xmlTree1 As XElement = <Root Att1="1"/>
Console.WriteLine(xmlTree1.HasAttributes)
Dim xmlTree2 As XElement = <Root/>
Console.WriteLine(xmlTree2.HasAttributes)
End Sub
End Class