r8226: update to new dtd writing functions