In some cases it might be easier to have a web-based approach to structuring with having to bother with a valid DTBook XML file. Just enter the title structure using markdown and have a server process which generates the proper DTBook for the given structure.