NodeTest elementTest = ((DocumentNodeTest)contextItemType).getElementTest();
IntHashSet requiredNames = elementTest.getRequiredNodeNames();
if (requiredNames != null) {
// check that the name appearing in the step is one of the names allowed by the nodetest
IntHashSet selected = test.getRequiredNodeNames();
if (selected != null && selected.intersect(requiredNames).isEmpty()) {
env.issueWarning("Starting at a document node, the step is selecting an element whose name " +
"is not among the names of child elements permitted for this document node type", this);
return Literal.makeEmptySequence();
}