Model-based document storage