Problem with extracting values from xml

Hi there again all
I am having trouble with retrieving data from an xml file
Here is the code I am using can anyone tell me where my problem lies?

function GetxmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
  
function GetxmlHttpObject() {
  var xmlDoc = GetxmlHttpObject();
  xmlDoc.load('coords.xml');
  var len = xmlDoc.childNodes.length;
 var newcoords = xmlDoc.childNodes(0).childNodes(0).firstChild.text;
 	parent.document.receiver.thepos.value = len;  
}

as I am very new to Javascript and AJAX I am not very familiar with the process yet and I have not been able to get the xml loaded.
Obviously I am declaring this all wrong as I receive the error that load is not a function of xmlDoc!

Hi there again I have changed tactics and am now using pototype.js
I seem to be able to get the tags though I am not sure how to access the text values of each tag.
can anyone help?

function makeMarkerXml() {
new Ajax.Request('coords.xml',
  {
    method:'post',
    onSuccess: function(transport){
var coordTags = transport.responseXML.getElementsByTagName('coords');
var coord =coordTags[0].text;///need to find the text and this doesn't work
parent.document.receiver.thecoord.value = 'XML child:'+coord;
     
    },
    onFailure: function(){ alert('Call failed') }
  });

 
}

var coord =coordTags[0].innerText;


Thanks though this didn’t work.
I can see the xml is loaded though firebug though I just can’t seem to work out why I can’t get the text value of each tag. I know theres nothing wrong with the xml as I can load and iterate the values in both flash AS and php.
anyone know how to retrieve the text value of a child node in xml.
Here is the xml format

<?xml version="1.0" encoding="UTF-8"?>
<cat>
<coord>
<coords>(-27.982240960539567, 153.4050145507813)</coords>
<description>A PHAT GIG</description>
<gid>61</gid>
<num>2</num>
<image>g_marker2.png</image>
<type>Gig</type>
</coord>
<coord>
<coords>(-28.00224937595136, 153.4269872070313)</coords>
<description>A Big Festival</description>
<gid>63</gid>
<num>3</num>
<image>r_marker3.png</image>
<type>Festival</type>
</coord>
<coord>
</cat>

Your XML has a mismatched <coord> tag at the end. Fix it and this will alert the data:

<html>
 <head>
  <title>TEST</title>
  
  
<script type="text/javascript">
   

function createRequest() 
{
 var request = null;  
 
 try {
    request = new XMLHttpRequest();
  } catch( e ) {
    try {
      request = new ActiveXObject("Msxml2.XMLHTTP");
    } catch ( ee ) {
      try {
        request = new ActiveXObject("Microsoft.XMLHTTP");
      } catch ( eee ) {
        request = null;
      }
    }
  }

 return request;
}

rq = createRequest();

rq.onreadystatechange = function()
{
 var XMLDoc;
   
 if( this.readyState == 4 )
 {
  if( this.status == 200 )
  {
   alert( this.responseXML.getElementsByTagName( 'coords' )[0].firstChild.nodeValue );
  }
  else
   alert('ERROR: ' + this.status + '\
\
' + this.statusText ) ;  
 } 
}

rq.open( 'get', 'coords.xml?r='+new Date().getTime(), true );

rq.send( null );


</script>
</head>
<body>
</body>
</html>