Creates a document with the given document definition name,
path, type, and source. if the type is not specified it will
attempt to infer the type based on IMT and the src.
If path is an empty string, then a UUID will be generated for
the XML, XSLT, and Schematron documents.
If the document definition specifies a full text index, then
the content is indexed