dump: Use dump functions in add_document_to_string