XNode.IsAfter determines if the current node appears after a specified node
Imports System
Imports System.Xml
Imports System.Xml.Schema
Imports System.Linq
Imports System.Collections
Imports System.Collections.Generic
Class MainClass
Shared Sub Main()
Dim xmlTree As XElement = _
<Root>Text content.
<Child1>child1 content</Child1>
<Child2>child2 content</Child2>
<Child3>child3 content</Child3>More text content.
<Child4>child4 content</Child4>
<Child5>child5 content</Child5>
</Root>
Dim child3 As XElement = xmlTree.<Child3>(0)
Dim child5 As XElement = xmlTree.<Child5>(0)
If (child5.IsAfter(child3)) Then
Console.WriteLine("Child5 is after Child3")
Else
Console.WriteLine("Child5 is not after Child3")
End If
End Sub
End Class