Q:

Calling an XML node by a Javascript into HTML works in Dreamweaver, but produces a blank page when I try it in a server

I'm trying to do a document.write for some xml to display in html.  Bear with me as I am a beginner at Javascript. Here's the code I have so far:
<script>
function loadXMLDoc()
{
if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xhttp.open("GET","Data/xmlfile.xml",false);
xhttp.send();
return xhttp.responseXML;
} 
</script>

<body>

<script>

    xmlDoc=loadXMLDoc("Data/xmlfile.xmll");
    var x=xmlDoc.getElementsByTagName("col");
[0].childNodes[0].nodeValue + "<br>");
    document.write(xmlDoc.getElementsByName("Rep")[1].childNodes[0].nodeValue + "<br>");
    document.write(xmlDoc.getElementsByName("Rep")[2].childNodes[0].nodeValue + "<br>");
    document.write(xmlDoc.getElementsByName("Rep")[3].childNodes[0].nodeValue + "<br>");
    document.write(xmlDoc.getElementsByName("Rep")[4].childNodes[0].nodeValue + "<br>");
    document.write(xmlDoc.getElementsByName("Rep")[5].childNodes[0].nodeValue + "<br>");
    document.write(xmlDoc.getElementsByName("Rep")[6].childNodes[0].nodeValue + "<br>");

</script> 

 <div><span class="reps"></span></div>

I also tried:  
    //r = document.getElementById("reps");
        //var inh=document.getElementById("reps").innerHTML;
        //r.innerHTML = document.write(xmlDoc.getElementsByName("Rep")

    document.getElementById("reps").innerHTML=xmlDoc.getElementsByName("Rep")[7].childNodes[0].nodeValue;

And then I tried:
  r.innerHTML = document.write(xmlDoc.getElementsByName("Rep")[0].childNodes[0].nodeValue + "<br>");

Upon researching some sites, it mentions that XML cannot be used with document.write.  Is this true?  Why does it work in Dreamweaver live, but not when I run it on a server?
How can I get this to work? 
Ultimately, I would like to draw each of the nodevalues from the XML and have it display in a div as separate hyperlinks.  Already I have the hyperlink in the XML and wrote the javascript as such:
document.write("9 - " + "<a href='" + xmlDoc.getElementsByName("RepWeb")[8].childNodes[0].nodeValue + "'>" + xmlDoc.getElementsByName("Rep")[8].childNodes[0].nodeValue + "</a>" + "<br>"); 

What am I doing wrong?

A:

Never Mind  I got it!  getElementsByName only works with Safari.  I ended up writing a new XML file and pulling the text by getElementByTagName

