@SuppressWarnings("unchecked")
    public Node createChildWithPredicate(final Node parentNode) {
        final Document document = DOMHelper.getOwnerDocumentFor(parentNode);
        //final Map<String, String> namespaceMapping = DOMHelper.getNamespaceMapping(document);
        final Map<String, String> namespaceMapping = new HashMap<String, String>(userDefinedMapping);
        namespaceMapping.putAll(DOMHelper.getNamespaceMapping(document));
        BuildDocumentVisitor visitor = new BuildDocumentVisitor(variableResolver, namespaceMapping, ONLY_LAST_STEP, MODE.JUST_CREATE);
        List<Node> nodes = (List<Node>) node.firstChildAccept(visitor, parentNode);
        assert nodes.size() == 1;
        return nodes.get(0);
    }
@ SuppressWarnings ( "unchecked" ) public Node createChildWithPredicate ( final Node parentNode ) { final Document document = DOMHelper . getOwnerDocumentFor ( parentNode ) ; final Map < String , String > namespaceMapping = new HashMap < String , String > ( userDefinedMapping ) ; namespaceMapping . putAll ( DOMHelper . getNamespaceMapping ( document ) ) ; BuildDocumentVisitor visitor = new BuildDocumentVisitor ( variableResolver , namespaceMapping , ONLY_LAST_STEP , MODE . JUST_CREATE ) ; List < Node > nodes = ( List < Node > ) node . firstChildAccept ( visitor , parentNode ) ; assert nodes . size ( ) == 1 ; return nodes . get ( 0 ) ; }
@param parentNode
@return fresh new node