Another question: How should we handle equality? According to the E4X spec, if regular equality is used, it returns true if the structure of the XML matches even if the objects are different objects. So:
var xml1 = <foo><baz /></foo>; var xml2 = <foo><baz/></foo>; xml1 == xml2 // true xml1 === xml2 // false xml1 === xml1 // true var xml1 = <foo><baz /></foo>; var xml2 = <foo><baz name="baz"/></foo>; xml1 == xml2 // false xml1 === xml2 // false xml1 === xml1 // true I’m thinking I should add an equals(xml) method which you’d map to the “==" operator.