public void writeXML(XMLOutput xmlOutput, boolean addMessages) throws IOException { XMLAttributeList attributeList = new XMLAttributeList() .addAttribute("classname", getClassName()) .addAttribute("start", String.valueOf(getStartLine())) .addAttribute("end", String.valueOf(getEndLine())) .addAttribute("startBytecode", String.valueOf(getStartBytecode())) .addAttribute("endBytecode", String.valueOf(getEndBytecode())) .addAttribute("opcodes", surroundingOpcodes);  if (isSourceFileKnown()) attributeList.addAttribute("sourcefile", sourceFile);  String role = getDescription(); if (!role.equals(DEFAULT_ROLE)) attributeList.addAttribute("role", getDescription());  if (addMessages) { xmlOutput.openTag(ELEMENT_NAME, attributeList); xmlOutput.openTag("Message"); xmlOutput.writeText(this.toString()); xmlOutput.closeTag("Message"); xmlOutput.closeTag(ELEMENT_NAME); } else { xmlOutput.openCloseTag(ELEMENT_NAME, attributeList); }
public void writeXML(XMLOutput xmlOutput) throws IOException { writeXML(xmlOutput, false);
	public void writeXML(XMLOutput xmlOutput, boolean addMessages) throws IOException {		XMLAttributeList attributeList = new XMLAttributeList()			.addAttribute("classname", getClassName())			.addAttribute("start", String.valueOf(getStartLine()))			.addAttribute("end", String.valueOf(getEndLine()))			.addAttribute("startBytecode", String.valueOf(getStartBytecode()))			.addAttribute("endBytecode", String.valueOf(getEndBytecode()))			.addAttribute("opcodes", surroundingOpcodes);				if (isSourceFileKnown())			attributeList.addAttribute("sourcefile", sourceFile);				String role = getDescription();		if (!role.equals(DEFAULT_ROLE))			attributeList.addAttribute("role", getDescription());		if (addMessages) {			xmlOutput.openTag(ELEMENT_NAME, attributeList);			xmlOutput.openTag("Message");			xmlOutput.writeText(this.toString());			xmlOutput.closeTag("Message");			xmlOutput.closeTag(ELEMENT_NAME);		} else {			xmlOutput.openCloseTag(ELEMENT_NAME, attributeList);		}	}