Custom DocType, Create from template similar to Project/Project Template

With Projects, you can create a Project Template that allows you to define a predefined project with a set of tasks. You can then create a Project from said template, and the new project will be prepopulated with Tasks that were part of the Project Template.

I would like to create a set of DocTypes that behaves similarly. Is the functionality that controls the “convert template to actual project” handled in code, or am I overlooking something? Will I need to code my own implementation for turning a custom “Template DocType” into a real DocType?