appendParameters(function, dispel, usedTypes, dtypePrefix);
dispel.append(")\n");
Tree ast = function.getBody();
convertTree(ast, usedTypes, dtypePrefix, dispel);
usedTypes.removeAll(function.getParameters().keySet());
NamespaceManager ns = function.getNamespaceManager();
// declare namespaces at the top of the file
dispel.insert(0,"\n");
for (String prefix : dtypePrefix)
{
dispel.insert(0, "\";\n");
dispel.insert(0, ns.resolvePrefix(prefix));
dispel.insert(0, " \"");
dispel.insert(0, prefix);
dispel.insert(0, "namespace ");
}
// write the used processing elements to the top of the file
dispel.insert(0,"\n");
for (String pe : usedTypes)
{
dispel.insert(0, ";\n");
dispel.insert(0, ns.resolve(pe));
dispel.insert(0, "use ");
}
// wrap the package qualifier around the function if there is one
wrapPackage(function.getName(), dispel);
return dispel.toString();