Map outputs = module.getOutputMap();
if (!outputs.isEmpty()) {
List outputList = toList(outputs.values());
Element outputsElem = new Element("outputs");
new ListSerializer(outputSerializer, "output")
.writeList(outputList, outputsElem);
elem.addContent(outputsElem);
}
//functions
List functions = module.getFunctionList();
if (!functions.isEmpty()) {
Element functionsElem = new Element("functions");
ListSerializer serializer = new ListSerializer(
new FunctionSerializer(
module.getParameterMap(), module.getOutputMap()),
"function");
serializer.writeList(functions, functionsElem);
elem.addContent(functionsElem);
}
}