Private oXmlTextWriter As XmlTextWriter = Nothing ' Create a XML ' expC1 File ' expO1 Encoding Public Function CreateXML(ByVal tcFile As String, ByVal tcEncoding As System.Text.Encoding) As Boolean ' Create the text writer oXmlTextWriter = New XmlTextWriter(tcFile, tcEncoding) oXmlTextWriter.Formatting = Formatting.Indented oXmlTextWriter.Indentation = 3 oXmlTextWriter.WriteStartDocument() Return True End Function ' Write a start element ' expC1 Tag ' expC2 Namespace Public Function WriteStartElement(ByVal tcTag As String, _ Optional ByVal tcNamespace As String = "") As Boolean ' If we do not have a namespace If tcNamespace.Length = 0 Then oXmlTextWriter.WriteStartElement(Trim(tcTag)) Else oXmlTextWriter.WriteStartElement(Trim(tcTag), tcNamespace) End If Return True End FunctionThe WriteStartElement() supports the tag and an optional namespace. However, in my case, I need to define something like this:
<BranchName xmlns="http://www.something.com" xsi:schemLocation="http://www.something.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Is this supported with XmlTextWriter?