generating document from data