{
  final List parseSortKeys(Node node)    throws TransformerConfigurationException, XPathExpressionException  {    List ret = new LinkedList();    while (node != null)      {        String namespaceUri = node.getNamespaceURI();        if (Stylesheet.XSL_NS.equals(namespaceUri) &&            Node.ELEMENT_NODE == node.getNodeType() &&            "sort".equals(node.getLocalName()))          {            NamedNodeMap attrs = node.getAttributes();            String s = getAttribute(attrs, "select");            if (s == null)              {                s = ".";              }            Expr select = (Expr) xpath.compile(s);            String l = getAttribute(attrs, "lang");            TemplateNode lang = (l == null) ? null :              parseAttributeValueTemplate(l, node);            String dt = getAttribute(attrs, "data-type");            TemplateNode dataType = (dt == null) ? null :              parseAttributeValueTemplate(dt, node);            String o = getAttribute(attrs, "order");            TemplateNode order = (o == null) ? null :              parseAttributeValueTemplate(o, node);            String co = getAttribute(attrs, "case-order");            TemplateNode caseOrder = (co == null) ? null :              parseAttributeValueTemplate(co, node);            ret.add(new SortKey(select, lang, dataType, order, caseOrder));          }        node = node.getNextSibling();      }    return ret.isEmpty() ? null : ret;  }