Extensions.Remove(T) removes every node in the source collection from its parent node.
Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim root As XElement = _
<Root>
<Data>1</Data>
<Data>2</Data>
<Data>3</Data>
<Data>4</Data>
<Data>5</Data>
</Root>
Dim elList = From el In root.Elements _
Where el.Value >= 3 _
Select el
elList.Remove()
Console.WriteLine(root)
End Sub
End Class