public static Ordering fromQOM(final OrderingImpl ordering,
final SharedFieldComparatorSource scs,
final NamespaceMappings nsMappings)
throws RepositoryException {
final Name[] selectorName = new Name[1];
QOMTreeVisitor visitor = new DefaultTraversingQOMTreeVisitor() {
public Object visit(LengthImpl node, Object data) throws Exception {
PropertyValueImpl propValue = (PropertyValueImpl) node.getPropertyValue();
selectorName[0] = propValue.getSelectorQName();
return new SortField(propValue.getPropertyQName().toString(),