private static boolean attributesEqual(XQNode n1, XQNode n2, Collator collator) {
assert (n1.nodeKind() == NodeKind.ELEMENT && n2.nodeKind() == NodeKind.ELEMENT);
if(n1 instanceof DMElement) {
assert (n2 instanceof DMElement);
DMElement e1 = (DMElement) n1, e2 = (DMElement) n2;
Iterator<DMAttribute> a1Itor = e1.attribute().iterator();
Iterator<DMAttribute> a2Itor = e2.attribute().iterator();
while(a1Itor.hasNext()) {
if(!a2Itor.hasNext()) {
return false;
}