Creates XmlWriter instance using the TextWriter and XmlWriterSettings objects.
Imports System
Imports System.IO
Imports System.Xml
Imports System.Text
Imports Microsoft.VisualBasic
Public Class Sample
Public Shared Sub Main()
Dim settings As New XmlWriterSettings()
settings.OmitXmlDeclaration = True
Dim sw As New StringWriter()
Using writer As XmlWriter = XmlWriter.Create(sw, settings)
writer.WriteStartElement("book")
writer.WriteElementString("price", "9.9")
writer.WriteEndElement()
writer.Flush()
Dim output As String = sw.ToString()
End Using
End Sub
End Class
Related examples in the same category