This commit also changes the generators for rst, xml and dockbook to preserve indentation. Closes #3032