NodeTypeManager nodeTypeManager = workspace.getNodeTypeManager();
NodeTypeTemplate template = nodeTypeManager.createNodeTypeTemplate();
template.setName("test:unstructured");
template.setDeclaredSuperTypeNames(
new String[] { "nt:unstructured" });
nodeTypeManager.registerNodeType(template, false);
Node root = session.getRootNode();
Node referenceable =
root.addNode("referenceable", "test:unstructured");