

var John = "<employee><name><first>John</first><last>Mcintosh</last></name><age>25</age></employee>";
var Sue = "<employee><name><first>Sue</first><last>James</last></name><age>32</age></employee>";
var Taro = "<employee><name><first>Taro</first><last>Matsuzawa</last></name><age>24</age></employee>";
var xml_doc = "<company>" + John + Sue + Taro + "</company>";

function sample() {
    var text = "";
    var doc = new XML(xml_doc);

    for each (var p in doc..employee) {
	with(p) {
	    var tmp = "Name: " + name.first + " " + name.last + " Age: " + age + "\n";
	    text = text + tmp;
	}
    }
    alert(text);
}


