question: public NodeList selectNodeList ( Node contextNode , Node xpathnode , String str , Node namespaceNode ) throws TransformerException { if ( ! str . equals ( xpathStr ) || xpathExpression == null ) { if ( xpf == null ) { xpf = XPathFactory . newInstance ( ) ; try { xpf . setFeature ( XMLConstants . FEATURE_SECURE_PROCESSING , Boolean . TRUE ) ; } catch ( XPathFactoryConfigurationException ex ) { throw new TransformerException ( "empty" , ex ) ; } } XPath xpath = xpf . newXPath ( ) ; xpath . setNamespaceContext ( new DOMNamespaceContext ( namespaceNode ) ) ; xpathStr = str ; try { xpathExpression = xpath . compile ( xpathStr ) ; } catch ( XPathExpressionException ex ) { throw new TransformerException ( "empty" , ex ) ; } } try { return ( NodeList ) xpathExpression . evaluate ( contextNode , XPathConstants . NODESET ) ; } catch ( XPathExpressionException ex ) { throw new TransformerException ( "empty" , ex ) ; } }
target:  Use an XPath string to select a nodelist. XPath namespace prefixes are resolved from the namespaceNode.