I am currently working as a Big Data Engineer, currently we are using XQuery to build the log files and to dump the data in Excel sheets and NoSQL DB. I have read the description of your project and I can understand that you actually want to get a script in XQuery that will save the end results in Excel Sheets that which database was queried, how many times the query was executed and what was the time of execution of query.