I've been following Uche Ogbuji's Javascript in Firefox series on Developerworks. It sounds like e4x will be in the next article. I can't wait. Here's the javascript form the "labels" example using e4x instead of DOM. Compare this javascript to Listing 2 in the article:
function loadAddresses(){
var doc = document.implementation.createDocument("", "", null);
doc.onload = function(){writeList(doc);};
doc.load("labels.xml");
}
function writeList(domDoc){
var xdoc = new XML((new XMLSerializer()).serailzeToString(domDoc.documentElement));
var xlist = <ol/>;
for each (label in xdoc..label){
xlist.* += <li>{label.name.text() + ' (' + label.@id + ')'}</li>;
}
document.getElementById('updateTarget').innerHTML = xlist;
}