Commiting updated DOMparser code with node looping method