XElement.Save (String) serialize this element to a file.
Imports System Imports System.IO Imports System.Xml Imports System.Xml.XPath Public Class MainClass Public Shared Sub Main() Dim root As XElement = _ <Root> <Child>child content</Child> </Root> root.Save("Root.xml") Dim Str As String = File.ReadAllText("Root.xml") Console.WriteLine(Str) End Sub End Class