-log 0, 'Writing processed file (%s)' % dstfile
-File.open(dstfile, 'w') {|f| f.write(xml.to_xml())}
+log 0, 'Writing processed file'
+# Unable to figure out API way to replace DOCTYPE
+data = xml.to_xml().gsub!(/DOCTYPE article/, 'DOCTYPE book')
+File.open(dstfile, 'w') {|f| f.write(data)}