getBugCollection().writeXML(outputStream, getProject());
if (!addMessages) {   getBugCollection().writeXML(outputStream, getProject()); } else {       DocumentFactory docFactory = new DocumentFactory(); Document document = docFactory.createDocument(); Dom4JXMLOutput treeBuilder = new Dom4JXMLOutput(document); getBugCollection().writeXML(treeBuilder, getProject());   AddMessages addMessages = new AddMessages(getBugCollection(), document); addMessages.execute();   XMLWriter writer = new XMLWriter(outputStream, OutputFormat.createPrettyPrint()); writer.write(document); }
	public void finish() {		try {			generateSummary();			getBugCollection().writeXML(outputStream, getProject());		} catch (Exception e) {			logError("Couldn't write XML output: " + e.toString());		}	}