}
  Collection document(String uri, String base)  {    if ("".equals(uri) || uri == null)      {        uri = this.base.getBaseURI();      }        // Get fragment    Expr fragment = null;    int hi = uri.indexOf('#');    if (hi != -1)      {        String f = uri.substring(hi + 1);        uri = uri.substring(0, hi);        // TODO handle xpointer() here        // this only handles IDs        fragment = new IdFunction(new Constant(f));      }    // Get document source    try      {        DOMSource source;        XSLURIResolver resolver = stylesheet.factory.resolver;        synchronized (resolver)          {            if (stylesheet.transformer != null)              {                resolver.setUserResolver(stylesheet.transformer.uriResolver);                resolver.setUserListener(stylesheet.transformer.errorListener);              }            source = resolver.resolveDOM(null, base, uri);          }        Node node = source.getNode();        if (fragment == null)          {            return Collections.singleton(node);          }        else          {            Object ret = fragment.evaluate(node, 1, 1);            if (!(ret instanceof Collection))              {                // XXX Report error?                return Collections.EMPTY_SET;              }            return (Collection) ret;          }      }    catch (TransformerException e)      {        String msg = "can't open " + uri;        if (base != null)          {            msg += " with base " + base;          }        throw new RuntimeException(msg);      }  }