Hello Daniweb,

I'm currently working on a pretty straight-forward AJAX application. In this application, I get some XML, and then parse it. An example of what I'm working with is as such:

<?xml version="1.0"?>
	<postRoot xml:lang="EN">
		<post type="comment" date="January 1, 1970">
        		<content>Hello World</content>        


Now, I've been able to read the XML with XMLHttpRequest , my trouble is with parsing the results. I've tried tons of things, but I just can't seem to get the different child nodes.

Now, let's say we have something like this:

var xml = xhr.responseXML;
var allPosts = xml.getElementsByTagName('post');

Could I use childNode to access user & content ? And if so, how? I've tried many things, but nothing is working :/ Is there a better way to parse the results I get back from the server?

Anyways, thanks in advance. I'm sure this is really simple, but I'm a C coder just trying Javascript for the first time, so I'm kinda lost. :)

<script type="text/javascript">
if (window.XMLHttpRequest)

	xmlhttp=new XMLHttpRequest();
	myXml = xmlDoc.documentElement.getElementsByTagName("post");
	var userValue = myXml[0].getElementsByTagName("user")[0].childNodes[0].nodeValue;
	var contentValue = myXml[0].getElementsByTagName("content")[0].childNodes[0].nodeValue;
	alert(userValue +","+ contentValue);