XPathNodeTest (XPathExpression argument) { if (argument instanceof XPathLocationPath) { final XPathStep step = ((XPathLocationPath)argument).getFirstStep(); if (step != null && step.getPreviousStep() == null && step.getPredicates().length == 0) { final XPathNodeTest test = step.getNodeTest(); if (test != null) { return test; } } } return null; }