public void writeXML(XMLOutput xmlOutput, boolean addMessages, boolean isPrimary) throws IOException {
XMLAttributeList attributeList = new XMLAttributeList().addAttribute("descriptor", descriptor);
String role = getDescription();
if (!role.equals(DEFAULT_ROLE)) {
attributeList.addAttribute("role", role);
}
if (typeParameters != null) {
attributeList.addAttribute("typeParameters", typeParameters);
}