Create XElement class from an XStreamingElement object.
Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim src As XElement = _
<Root>
<Child1>1</Child1>
<Child2>2</Child2>
<Child3>3</Child3>
</Root>
Dim xse As XStreamingElement = New XStreamingElement("NewRoot", _
From el In src.Elements() _
Where (CInt(el) >= 2) _
Select el _
)
Console.WriteLine(xse)
src.Add(New XElement("Child4", 4))
Console.WriteLine(xse)
End Sub
End Class