Document generation framework