Forcing XmlWriter to use 'invalid' characters
<p>I am converting an EDIFACT file to an OUIUBL file (technically just an XML file), <strong>(Essentially I'm creating an XML file)</strong> and I want to have prefixes in my tags like "cac:" for instance. E.g.  </p>

<pre><code>&lt;cac:Tax&gt;
    &lt;cbc:Amount&gt;500.00&lt;/cbc:Amount&gt;
&lt;/cac:Tax&gt;
</code></pre>

<p>I am using an XmlWriter to create the xml, essentially doing it like so:  </p>

<pre><code>writer.WriteStartDocument()
writer.WriteStartElement("cac:Tax")
writer.WriteElementString("Amount", "500.00")
writer.WriteEndElement()
writer.WriteStartDocument()
</code></pre>

<p>But I get an error saying that ":" is an invalid character. How do I force it to use it anyway? I have tried the following  </p>

<pre><code>Dim settings As XmlWriterSettings = New XmlWriterSettings()
settings.Indent = True
settings.CheckCharacters = false
</code></pre>

<p>And I've also tried setting a prefix and namespace for the startElement:  </p>

<pre><code>writer.WriteStartElement("cac", "Tax", Nothing)  
</code></pre>

<p>But neither of those seemed to work... Well setting the prefix did, but only if I also declare a namespace, and I don't want that.  </p>

<p>I want it to format it like xml but neglect any syntactic differences :)</p>