render function

Render a model to a document