private static AttributeDomain parseDomain(Element domainElem) throws IOException {
        if (domainElem == null) return null;
        try {
            if (domainElem.getAttribute("type").equals("continuous")) {
                ContinuousAttributeDomain domain = new ContinuousAttributeDomain();
                NodeList nList = domainElem.getElementsByTagName(XML_CONT_VAL);
                for (int i = 0; i < nList.getLength(); i++) {
                    Node node = nList.item(i);
                    if (node.getNodeType() == Node.ELEMENT_NODE) {
                        Element e = (Element) node;
                        domain.addKnot(Double.parseDouble(e.getAttribute("x")), 
                                       Double.parseDouble(e.getAttribute("y")));
                    }
                }
                return domain;
            } else {
                DiscreteAttributeDomain domain = new DiscreteAttributeDomain();
                NodeList nList = domainElem.getElementsByTagName(XML_DISC_VAL);
                for (int i = 0; i < nList.getLength(); i++) {
                    Node node = nList.item(i);
                    if (node.getNodeType() == Node.ELEMENT_NODE) {
                        Element e = (Element) node;
                        domain.addElement(e.getAttribute("x"), 
                                       Double.parseDouble(e.getAttribute("y")));
                    }
                }
                return domain;
            }
        } catch (Exception ex) {
            throw new IOException(domainElem.getUserData(PositionalXMLReader.LINE_NUMBER).toString());
        }
    }