cdlDocument.parse(this);
cdlDocument.parseImportedDocument(this);
    private ImportedDocument doImport(String path, String namespace)            throws IOException, ParsingException, CdlException {        if (log.isDebugEnabled()) {            log.debug("Importing " + path);        }        URL referenceURL=importResolver.createReferenceURL(path);        URL sourceURL = importResolver.convertToSourceURL(referenceURL);        if (log.isDebugEnabled()) {            log.debug("Importing ns=" + namespace + " url " +referenceURL+" from "+ sourceURL);        }        //we now have a location; let's load it.        InputStream inputStream = getUrlFactory().openStream(sourceURL);        CdlDocument cdlDocument;        try {            //open the document            CdlParser parser = createParser();            cdlDocument = parser.parseStream(inputStream);            //patch the document's origin            cdlDocument.setDocumentURL(referenceURL);            //recursive parse            cdlDocument.parse(this);        } finally {            inputStream.close();        }        //return the newly imported document        ImportedDocument imported = new ImportedDocument();        imported.setDocument(cdlDocument);        imported.setNamespace(namespace);        imported.setLocation(path);        return imported;    }