NodeTypeManager ntMgr = s.getWorkspace().getNodeTypeManager();
// init with repository predefined node types
Set<String> written = new HashSet<String>();
written.addAll(ServiceProviderFactory.getProvider().getBuiltInNodeTypeNames());
StringWriter out = new StringWriter();
CNDWriter w = ServiceProviderFactory.getProvider().getCNDWriter(out, s, true);
for (String nt: nodeTypes) {
writeNodeType(ntMgr.getNodeType(nt), w, written);
}
w.close();
return new ByteArrayInputStream(out.getBuffer().toString().getBytes("utf-8"));
}