To put your code into the CODE tags use the hash mark (#) located in the tool bar above the Message box.
Your xml show nicely because it uses a style sheet named applyt.xsl.
I saved your xml file as customers.xml since you did not tell us a name for it. The following is html to display what you wanted. BUT you have to know the name. I could add js to show all the names or you could try it as an exercise.
Code:
<!DOCTYPE html> <!-- Zack Zwyker zack zwyker -->
<html>
<body>
<input type="text" onblur="display(this.value);">
<script>
function loadXMLDoc(dname)
{
if (window.XMLHttpRequest)
{
xhttp=new XMLHttpRequest();
}
else
{
xhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET",dname,false);
xhttp.send("");
return xhttp.responseXML;
}
function display(Aname){
xml=loadXMLDoc("customers.xml");
path="/customers/person/name"
x=xml.getElementsByTagName("first")[0].childNodes[0];
for(z=0; z<x.length; z++){
x=xml.getElementsByTagName("first")[z].childNodes[0];
y=xml.getElementsByTagName("last")[z].childNodes[0];
TheName = x.nodeValue+" "+y.nodeValue;
if(TheName.toLowerCase() == Aname.toLowerCase()){
document.write(x.nodeValue+" "+y.nodeValue+"<br />");
document.write(xml.getElementsByTagName("street")[z].childNodes[0].nodeValue+"<br />");
document.write(xml.getElementsByTagName("city")[z].childNodes[0].nodeValue+"<br />");
document.write(xml.getElementsByTagName("state")[z].childNodes[0].nodeValue+"<br />");
document.write(xml.getElementsByTagName("postcode")[z].childNodes[0].nodeValue+"<br />");
document.write(xml.getElementsByTagName("country")[z].childNodes[0].nodeValue+"<br />");
document.write(xml.getElementsByTagName("email")[z].childNodes[0].nodeValue+"<br />");
}
}
}
</script>
</body>
</html>