db.as_json/as_xml thanks Alan (This is tentative and experimental)