title_body: What is the easiest workflow to publish ePub files from highly structured database content?
upvoted_answer: I recommend you generate some mark up format supported as input for pandoc (i.e. markdown, reST, HTML) and generate the EPUB from that. 
  
  You should have no trouble scripting pandoc, but you would need some work automating the generation of the markup from your database (but not more than you would have generating XML).