handy trick: `Array.prototype.forEach.call(node.attributes, function(element) { ....});` effects the `forEach` function on the node list. Alternatively, you can do `nodelist = Array.prototype.slice.call(nodelist)` to "cast" it to a real array.