Namespace XmlTest Sub TestMain() Dim doc = New System.Xml.XmlDocument() doc.AppendChild( doc.CreateXmlDeclaration( "1.0", "UTF-8", Nothing ) ) doc.AppendChild( doc.CreateElement( "root" ) ) doc.ChildNodes[1].AppendChild( doc.CreateElement( "test" ) ) System.Diagnostics.Debug.WriteLine( doc.OuterXml() ) End Sub End Namespace XmlTest.TestMain()