Much better tutorial:
http://www.xml.com/pub/a/2007/10/10/jquery-and-xml.html
In your case you want to loop through the return XML object, using a jQuery selector. For each "var" tag you find, you can determine the value of the name attribute using the attr() function. Something like this:
PHP Code:
$('var').each(function() {
var varName = $(this).attr('name');
});