write a document to wrod