updated xquery for generating json to include IDs

moreover fixed to work with local file also although using local
exist-db as transformation engine in oXagen
added measureID feedback