ENH:finish function writeinsert in xmltocs