Take a look into attributes. Basically the same kind of array stuff you've done with the nodes, just that you need to work out the attributes for each node. If you're not sure how to access attributes, open up Object Browser and look from there what you need, the naming convention is similar (IXMLDOMAttributes or something).