private void applyGradientExceptOnEdge(Document document) throws XPathExpressionException {
        Element root = document.getDocumentElement();

        // --- replace fill by a nice looking... gradient

        XPathExpression xPathExpression = xml.compileXPath("descendant::polygon[@fill and parent::g[@class != 'edge']]");
        NodeList evaluate = (NodeList)xPathExpression.evaluate(root, XPathConstants.NODESET);

        // skip the first node which acts as a bounding box
        for(int i=1;i<evaluate.getLength();i++) {
            Element element = (Element)evaluate.item(i);
            String color = element.getAttribute("fill");
            if(color.equals("none")) {
                color = defaultColor;
            }
            element.setAttribute("style","fill:url(#GradientNode-" + color + ")");
            element.setAttribute("filter","url(#FilterShadow)");
            element.removeAttribute("fill");
        }

        // --- replace fill:none by fill:white
//        xPathExpression = xml.compileXPath("descendant::*[@fill='none']");
//        evaluate = (NodeList)xPathExpression.evaluate(root, XPathConstants.NODESET);
//        for(int i=1;i<evaluate.getLength();i++) {
//            Element element = (Element)evaluate.item(i);
//            element.setAttribute("fill", "white");
//        }
    }