for (Iterator itNs = def.getNamespaces().keySet().iterator(); itNs.hasNext();) { String key = (String) itNs.next(); String val = def.getNamespace(key); flat.addNamespace(key, val); }
    private void addNamespaces(Definition flat, Definition def) {        for (Iterator itNs = def.getNamespaces().keySet().iterator(); itNs.hasNext();) {            String key = (String) itNs.next();            String val = def.getNamespace(key);            flat.addNamespace(key, val);        }        for (Iterator itImport = def.getImports().values().iterator(); itImport.hasNext();) {            List defImports = (List) itImport.next();            for (Iterator iter = defImports.iterator(); iter.hasNext();) {                Import defImport = (Import) iter.next();                addNamespaces(flat, defImport.getDefinition());            }        }    }