Add support for createDocumentFromSource.