Node xpathNode= DOMUtil.getSingleNode(rootNode, path,
Node xpathNode= DOMUtil.getSingleNode(rootNode, location,
    private void contractProcessingEnd() throws SAXException {        try {            contract.setContractResultData();            Document node = (Document) contract.getContractResultData()                    .getNode();            Document root = this.rootNode.getOwnerDocument();            /*             * debug code - uncomment it if you need it! will output the             * contract resulting data to sysout             */            // DOMSource source = new DOMSource(node);            // StreamResult result = new StreamResult(System.out);            // contract.getContractTransformer().transform(source, result);            /*             * append this node to the current path after testing where there is             * a fixed location for the contract content. If so then add it             * there.             */            NodeList contentChildren = node.getElementsByTagNameNS(                    DispatcherHelper.DISPATCHER_NAMESPACE_URI, "part");            for (int i = 0; i < contentChildren.getLength(); i++) {                Element contentChild = (Element) contentChildren.item(i);                NodeList finalContent = contentChild.getChildNodes();                if (contentChild != null) {                    String location = contentChild.getAttribute("xpath");                    if (location.equals("") | location == null) {                        Node xpathNode = DOMUtil.getSingleNode(rootNode, path,                                this.processor);                        if (xpathNode != null) {                            // add everything *within* the forrest:part element                            appendChildToResultIterator(root, finalContent,                                    xpathNode);                        }                    } else {                        if (location.charAt(0) == '/')                            location = "result" + location;                        else                            location = "result/" + location;                        Node xpathNode= DOMUtil.getSingleNode(rootNode, path,                                this.processor);                        if (xpathNode != null) {                            // add everything *within* the forrest:part element                            appendChildToResultIterator(root, finalContent,                                    xpathNode);                        } else {                            xpathNode = createXpathNode(location);                            // add everything *within* the forrest:part element                            appendChildToResultIterator(root, finalContent,                                    xpathNode);                        }                    }                }            }        } catch (Exception e) {            String error = "dispatcherError: "                    + DispatcherException.ERROR_500                    + "\n"                    + "The contract \""                    + contract.getContractName()                    + "\" has thrown thrown an exception while trying to transform the final markup. \n\n"                    + "dispatcherErrorStack:\n " + e;            getLogger().error(error);            throw new SAXException(error);        } finally {            this.contract.recycle();        }    }