[WIP] Added support for declarative document types.