Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim xmlTree1 As XElement = _
<Root>
<Child>1</Child>
<Child>2</Child>
<Child>3</Child>
<Child>4</Child>
<Child>5</Child>
<Child>6</Child>
</Root>
Dim xmlTree2 As XElement = _
<Root>
<%= From el In xmlTree1.Elements() _
Where el.Value >= 3 And el.Value <= 5 _
Select el %>
</Root>
Console.WriteLine(xmlTree2)
End Sub
End Class