How (im)possible would it be for there to be a set of methods for checking document order of elements. Something like boolean Element.before(Element that) boolean Element.after(Element that) XPath muck sometimes cares about document order of Elements.