I have a large xml and need to extract some xml tags containing some 16 characters codes used in my company to identify things.
the problem is that this code is contained inside tags <Ident> and all through-out the xml the tag <Ident> also contains other stuff, I need to extract only the ones with the codes.






<AgencyDescription>SupplyCentre Seller</AgencyDescription>

and so on for several lines and more lines, as you can see the tag <Ident> is used for many things but I am only interested in the one containing that long code.

So far I am using:

var i, n_elems, elems = xml_doc.getElementsByTagName("Ident");
n_elems = elems.length;
for (i = 4; i < n_elems; i++)
document.write(elems[i].firstChild.nodeValue + "<br>" + "<br>");

but this is returning ALL <Ident> tags, how can I make this conditional?