Document result = db.createDocument();
result.replaceItemValue("$$SchemaType", doctype);
result.replaceItemValue("form", def.getName());
Map<String, IItemDefinition> itemDefs = def.getItemDefinitions();
for (String key : itemDefs.keySet()) {
IItemDefinition itemDef = itemDefs.get(key);
Item item = itemDef.createDefaultItem(result, def);
}
return result;
}