private void scanDatasets() throws XPathExpressionException, Exception {
        // scan datasets
        logger.info("setup datasets");
        NodeList datasetNodes = (NodeList) xPath.evaluate("/datagenerator/dataset", configuration, XPathConstants.NODESET);
        
        int nds = datasetNodes.getLength();
        for (int i = 0; i < nds; i++) {
            // for each dataset:
            Dataset d = new Dataset();
            // fetch reference and params
            HashMap params = fetchParams((Element) datasetNodes.item(i));
            String reference = datasetNodes.item(i).getAttributes().getNamedItem("ref").getTextContent();
            d.setParams(params);
            d.setReference(reference);

            //fecth and set destination:
            String destRef = (String) xPath.evaluate("@destination", datasetNodes.item(i), XPathConstants.STRING);
            Destination dest = destinations.get(destRef);
            
            //fecth and set column
            NodeList columnsNodes = (NodeList) xPath.evaluate("column", datasetNodes.item(i), XPathConstants.NODESET);
            int ncol = columnsNodes.getLength();

            d.setDestination(dest);
            for (int j = 0; j < ncol; j++) {
                HashMap colparams = fetchParams((Element) columnsNodes.item(j));
                Column c = new Column(colparams);
                d.addColumn(c);
            }
            
            //add the dataset to the datasets
            datasets.put((String) reference, (Dataset) d);
        }
    }