class XPathParser {

    protected DocumentTest parseDocumentTest( TokenStream tokens ) {
        if (tokens.canConsume("document-node", "(")) {
            // Document test ...
            ElementTest elementTest = parseElementTest(tokens);
            DocumentTest result = null;
            if (elementTest != null) {
                result = new DocumentTest(elementTest);
            } else {
                SchemaElementTest schemaTest = parseSchemaElementTest(tokens);
                result = schemaTest != null ? new DocumentTest(schemaTest) : null;
            }
            tokens.consume(")");
            return result;
        }
        return null;
    }

    public  XPathParser( TypeSystem context );

}