Full support for templates that are sub-documents