Reads the content of a stream to document.
If document was not set, treates a new DomDocument
Returns: document's value