logError("Couldn't write XML output: " + e.toString());
logError("Couldn't write XML output", e);
	public void finish() {		generateSummary();		try {			if (!addMessages) {				// Plain XML output.				// Write XML directly to the output stream.				getBugCollection().writeXML(outputStream, getProject());			} else {				// XML output with messages.				// This requires us to build a dom4j tree,				// add the messages to it, and then				// write the tree to the output stream.				// Build tree				Document document = getBugCollection().toDocument(getProject());				// Add messages				AddMessages addMessages = new AddMessages(getBugCollection(), document);				addMessages.execute();				// Write to output stream				XMLWriter writer = new XMLWriter(outputStream, OutputFormat.createPrettyPrint());				writer.write(document);			}		} catch (Exception e) {			logError("Couldn't write XML output: " + e.toString());		}	}