implement indent option for document.to_s and document.save