if (sorted) { for(BugInstance bugInstance : getBugCollection().getCollection()) bugInstance.writeXML(xmlOutput, addMessages); }
	public void finish() {		try {			getReady(); // If no warnings were issued, then nothing has been written yet			if (addMessages) {				writeBugCategories();				writeBugPatterns();				writeBugCodes();			}						getBugCollection().writeEpilogue(xmlOutput);		} catch (IOException e) {			throw new FatalException("Error writing XML output", e);		} finally {			try {				xmlOutput.finish();			} catch (IOException e) {				// Ignore			}		}	}