public AsyncImportResult(Document asyncImportResultXml)
    {
        Element elem = ((Element)(asyncImportResultXml
                                .getElementsByTagName("status")).item(0));
        
        String statusText = XmlUtils.getElemText(elem);
        
        if (statusText.equals("created")){
            this.status = ImportStatus.CREATED;
        }  else if (statusText.equals("running")) {
            this.status = ImportStatus.RUNNING;
        } else if (statusText.equals("finished")) {
            this.status = ImportStatus.FINISHED;
        } else if (statusText.equals("error")) {
            this.status = ImportStatus.ERROR;
        }

        if (this.status == ImportStatus.FINISHED) {
            this.importResults = ImportResult.ConvertToImportResults(asyncImportResultXml);
        }

        if (this.status == ImportStatus.ERROR) {
        	Element errElem = ((Element)(asyncImportResultXml
                    				.getElementsByTagName("error")).item(0));
        	
        	try { this.errorCode = Integer.parseInt(errElem.getAttribute("code")); }
        	catch (NumberFormatException nfe) {}
        	
            this.errorMessage = XmlUtils.getElemText(errElem);
        }
    }