title: How can I append a child node to an element in a DOM object?
body: <pre><code>&lt;%
      Set xmlDoc = Server.CreateObject("MSXML2.DOMDOCUMENT")
      xmlDoc.loadXML( "&lt;response /&gt;" )
  
      Set node = xmlDoc.createElement("account")
      xmlDoc.documentElement.AppendChild node
  
      Set node = xmlDoc.createElement("type")
      node.Text = "TheType"
      xmlDoc.documentElement.AppendChild node
  
      Set node = Nothing
  %&gt;
  </code></pre>
  
  <p>This creates an XML doc that looks like the following:</p>
  
  <pre><code>   &lt;response&gt;
          &lt;account&gt;&lt;/account&gt;
          &lt;type&gt;TheType&lt;/type&gt;
     &lt;/response&gt;
  </code></pre>
  
  <p>How do I append the "type" node as a child node to the "newaccount" node so that it looks like this:</p>
  
  <pre><code>   &lt;response&gt;
          &lt;account&gt;
              &lt;type&gt;TheType&lt;/type&gt;
          &lt;/account&gt;
     &lt;/response&gt;
  </code></pre>