separate app-service from datastore backend
exist-db can be used both to run xquery apps and to store xml data but combining this into one service is a violation of best practices
separate application logic from datastore
provide datastore service that is consumed by the app service as an attached resource
this issue also resolves the problem that for a persistent database instance with app and data stored into the same instance the deployment of an app update needs manual or programmatic removal of the old app and installation of the new.