Split json metadata from xml by writing separate files, and then merge the xml file into the json data them when uploading to couchdb