Imports System
Imports System.IO
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim srcTree As XDocument = _
data1
data2
data3
data4
info5
info6
info7
info8
Dim doc As XDocument = _
<%= From el In srcTree..Elements _
Where CStr(el).StartsWith("data") _
Select el %>
doc.Save("Test.xml")
Console.WriteLine(File.ReadAllText("Test.xml"))
End Sub
End Class