add wr(a) = doc.write(a)