Turns an XML DOM level 2 document into a JavaScript object