var x=xmlDoc.getElementsByTagName('categoria'); for (i=0;i<x.length;i++) { document.write(x[i].getAttribute('dato')); document.write("<br />"); }