function selectXPath(expr, node) {
	if (document.evaluate) {
		return {
			list : node.evaluate(expr,node,null,XPathResult.ANY_TYPE,null),
			next : function() { 
				return this.list.iterateNext()
			}
		}
	} else {
		return {
			list: node.selectNodes(expr),
			i : 0,
			next: function() {
				if (this.i > this.list.length)
  				return null;
				return this.list[this.i++];
			}
		}
	}
}


