Because all classes that derive from XObject contain a NodeType property, you can write code that operates on collections of concrete subclass of XObject. Your code can then test for the node type of each node in the collection.
Dim output AsNew StringBuilder
Dim root As XElement = <Root Att="content"/>
Dim att As XAttribute = root.FirstAttribute
output.Append(att.NodeType.ToString)
output.Append(Environment.NewLine)
OutputTextBlock.Text = output.ToString()