I've been looking for a template to achieve this. Apparently, only commercial applications, such as oXygen can do that.
Is there any free tool that can do it? Or at least it would be great to have a base template to customize instead of writting it from scratch.
Closest tip I found in SO is not very promising.
First of all, OxygenXML has a free trial license that will not watermark your output in any way. Probably the quickest way. Still, I am a bit curious why Docbook in particular - it is an intermediary format not meant for end user user consumption, I guess the idea is you want to then produce a nice looking PDF and HTML out of that? If that's the case, not a bad plan. Also it's not a whole lot of work to write your own XSL stylesheet to do that, you just need to map:
complexType
andsimpleType
andelement
to db:sectionxs:name
todb:title
andxd:annotation
topara
then you can process this with free tools like saxon and docbook toolkit.