public void writeDataType(DataType type, Element elem) {
elem.setAttribute("content", type.getContentType());
//append memberType element for list data types:
if (type instanceof ListDataType) {
ListDataType listType = (ListDataType)type;
Element memberTypeElem = new Element("memberType");
writeDataType(listType.getMemberType(), memberTypeElem);
elem.addContent(memberTypeElem);
}
}