writeDocDoc, it probably should merge with writeCoCo, but that makes the readability much worse.