var parser = NEW DOMParser(); var docXML = parser.parseFromString(readXml, "application/xml"); console.LOG(docXML); let config = docXML.querySelectorAll('config'); IF (config.LENGTH != 0) { config.forEach(configElement => { console.LOG(JSON.stringify(configElement)); FOR (let j = 0; j < configElement.children.LENGTH; j++) { let ROW = configElement.children[j].innerHTML; let rowName = configElement.children[j].nodeName; //console.LOG(configElement.children[j].nodeName); //console.LOG(ROW); var mapTest = NEW Map(); mapTest.SET(rowName, ROW); arr.push(mapTest); FOR (let k = 0; k < configElement.children[j].children.LENGTH; k++) { let row2Value = configElement.children[j].children[k].innerHTML; let row2Name = configElement.children[j].children[k].nodeName; //console.LOG(configElement.children[j].children[k].nodeName); //console.LOG(ROW); var mapTest2 = NEW Map(); mapTest.SET(rowName, mapTest2.SET({ row2Name, row2Value })); //mapTest.SET(mapTest2.SET(mapTest2.SET(row2Name, row2Value))); } } }); } ELSE { console.LOG("XML do not have tag config"); }