title: Adding XML declaration and DOCTYPE to XML with VBScript
body: <p>I can't figure out how to add simple XML and Doctype declarations to an XML file I am generating. I'm creating and adding nodes fine but that code doesn't seem to work for doing this. My code is as follows:</p>
  
  <pre><code>Set xmlDoc = CreateObject("Microsoft.XMLDOM")
  
  Set objDoctype = xmlDoc.createElement("DOCTYPE")
  xmlDoc.appendChild objTop
  </code></pre>
  
  <p>I found this link: <a href="http://www.example-code.com/vbscript/xml_doctype.asp" rel="nofollow">http://www.example-code.com/vbscript/xml_doctype.asp</a> which doesn't seem to work for me because it looks like they are editing the file as a TXT file.</p>
  
  <p>Also, I need to add this declaration to the top of my XML file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p>Thanks for your help!</p>
  
  <h2>EDIT</h2>
  
  <p>What I would like to see on the top of the XML file is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE catalog SYSTEM "shopstyle-catalog.dtd"&gt;
  </code></pre>
  
  <p>Thanks!</p>