private void scanDestinations() throws XPathExpressionException {
        // scan destinations
        logger.info("setup destinations");
        String xPathDestionations = "/datagenerator/global/destinations/destination";
        NodeList destinationNodes = (NodeList)xPath.evaluate(xPathDestionations, configuration, XPathConstants.NODESET);

        int ndest = destinationNodes.getLength();
        logger.debug("found " + ndest+ " destinations:");
        for (int i = 0; i < ndest; i++) {
            try {
                HashMap params = fetchParams((Element) destinationNodes.item(i));
                String reference = destinationNodes.item(i).getAttributes().getNamedItem("ref").getTextContent();
                String type = destinationNodes.item(i).getAttributes().getNamedItem("type").getTextContent();
                logger.debug(i + " - " + reference + " - " + type);
                NodeList destinationParamsNodes = (NodeList) xPath.evaluate("param", destinationNodes.item(i), XPathConstants.NODESET);
                int nparamsdest = destinationParamsNodes.getLength();
                HashMap<String, String> destParams = new HashMap<String, String>();
                String paramName="";
                String paramValue = "";
                for (int ip = 0; ip < nparamsdest; ip++) {
                    paramName = destinationParamsNodes.item(ip).getAttributes().getNamedItem("name").getTextContent();
                    paramValue = destinationParamsNodes.item(ip).getAttributes().getNamedItem("value").getTextContent();
                    destParams.put(paramName, paramValue);
                    logger.trace("destination param '"+paramName+"' set to '"+paramValue+"'");
                }
                Destination d = (Destination) DestinationFactory.newInstance(type,destParams);
                d.setReference(reference);
                destinations.put(reference, (Destination) DestinationFactory.newInstance(type,destParams));
            } catch (UnsupportedDestinationException ex) {
                logger.error(ex.getMessage());
            }
        }
    }