<BICS_VIEW>
<SERVICE_DESCRIPTION>
<QUERY>Z_ZHRPAM01_Q_0001</QUERY>
</SERVICE_DESCRIPTION>
<INFO_PROVIDER name="ZHRPAM01" text="Headcount Multiprovider"/>
<QUERY name="Z_ZHRPAM01_Q_0001" text="Headcount Projection Report">
</QUERY>

I amtrying to retrieve "Z_ZHRPAM01_Q_0001" with the below javascript but i still canít get it to work. any help appreciated!!

function help()
{

root = document.childNodes[0]; // <HTML>
body = root.getElementsByTagName("BODY")[0]; // <BODY>
xml = body.getElementsByTagName("XML")[0]; // <XML>
bics = xml.childNodes[0]; // <BICS_VIEW>
varl = bics.getElementsByTagName("SERVICE_DESCRIPTION");
for ( i = 0; i <= varl.length; i++ ) // Loop one by one
{
vari = bics.getElementsByTagName("SERVICE_DESCRIPTION")[i];
y=vari.childNodes[0];
alert(y.nodeValue);
}