Adding support to get the document as text