End-users information capture remains a sensitive challenge, especially when information is under the form of documents. The difficulty concerns information indexing so that information can be precisely queried. In the DRUID project, the end-user captures XML paragraph-centric documents (i.e. documents with tags delimiting narrative text paragraphs), and a transformation tool generates XML data-centric documents that can be stored in a database. The database can then be queried to retrieve documents. Data-centric and paragraph-centric documents conform to DTDs. In this article, we present algorithms to automatically generate DTDs from the database schema.