title: Using Excel VBA to create an XML file
body: <p>I'm trying to create an XML file from VBA found in Excel, I'm a little hazy on the details though, I've never touched XML or VBA before in my life. I need to write out an XML file with in the following format:</p>
  
  <pre><code>&lt;TextField0 xfdf:original="Brand Name"&gt;HEADING1&lt;/TextField0&gt;
  </code></pre>
  
  <p>There will be a bunch of lines like this such as TextField1, which is "Product" and so on. The code I have thus far revelent to this section is this:</p>
  
  <pre><code>   'create Heading element
     Set objXMLelement = objDom.createElement("TextField0")
     objXMLRootelement.appendChild objXMLelement
  
     'create Attribute to the Heading Element and set value
     Set objXMLattr = objDom.createAttribute("xfdf:original")
     objXMLattr.NodeValue = "Brand Name"
     objXMLelement.setAttributeNode objXMLattr
  </code></pre>
  
  <p>That creates this output:</p>
  
  <pre><code>&lt;TextField0 xfdf:original="Brand Name"/&gt;
  </code></pre>
  
  <p>This is of coursem missing HEADING1 and I can't for the life of me figure out how to put that bit in there. I can't seem to append anything to an attribute. Any help will be gratefully received.</p>