have a look here: XML Parser
you load the xml into an xml document, and then access the elements the same way you would on your page's document:
//initialize your xml for testing purposes
txt='<s:Envelope xmlns:s="http://schemas.example.org/soap/envelope/">';
txt=txt+'<s:Header/>';
txt=txt+'<s:Body>';
txt=txt+'<ProductIdResponse xmlns="http://example.org/">';
txt=txt+' <Product>123</Product>';
txt=txt+'<ProductIdResponse>';
txt=txt+'</s:Body>';
txt=txt+'</s:Envelope>';
if (window.DOMParser) {
parser = new DOMParser();
xmlDoc = parser.parseFromString(txt, "text/xml");
} else // Internet Explorer
{
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = false;
xmlDoc.loadXML(txt);
}
var myProduct = xmlDoc.getElementsByTagName("Product")[0].innerHTML;
alert(myProduct);
If you dont want to parse the xml into DOM, you can alternatively retrieve the data using RegEx matching
check Here for a good RegEx tester where you can practice regex.
//initialize your xml for testing purposes
txt = '<s:Envelope xmlns:s="http://schemas.example.org/soap/envelope/">';
txt = txt + '<s:Header/>';
txt = txt + '<s:Body>';
txt = txt + '<ProductIdResponse xmlns="http://example.org/">';
txt = txt + ' <Product>123</Product>';
txt = txt + ' <Product>Product 2</Product>';
txt = txt + '<ProductIdResponse>';
txt = txt + '</s:Body>';
txt = txt + '</s:Envelope>';
var myProducts = txt.match(/<Product>(.*?)<\/Product>/g);
myProducts.forEach(function(val, id) {
myProducts[id] = myProducts[id].replace(/(<([^>]+)>)/ig, "");
});
console.log(myProducts);
alert("2nd product is: " + myProducts[1]);