Dim doc = XDocument.Load("D:\TEMP\Sample.xml", LoadOptions.PreserveWhitespace) Dim newSite = <Site Location="d">C:\temp</Site> doc.Root.Add(newSite) doc.Root.Add(vbCrLf) doc.Save("D:\TEMP\Sample2.xml")