measureEl.addAttribute("ID", measure.getUri());
addStringElement(measureEl, "name", measure.getName());
addStringElement(measureEl, "description", measure.getDescription());
Attribute attribute = (Attribute) measure.getAttribute();
if (attribute != null) {
Element attributeEl = measureEl.addElement("attribute");
attributeEl.addAttribute("ID", attribute.getUri());
addStringElement(attributeEl, "name", attribute.getName());
addStringElement(attributeEl, "description", attribute.getDescription());
CriterionCategory category = attribute.getCategory();
Element categoryEl = attributeEl.addElement("category");
categoryEl.addAttribute("ID", category.getUri());
categoryEl.addAttribute("scope", category.getScope().toString());
addStringElement(categoryEl, "name", category.getName());
}