Outputting user-customized datasets efficiently with XML or JSON?

Outputting user-customized datasets efficiently with XML or JSON?

Hi All:
 
I run a site that outputs customized data based on a user's input.  That is, a customer puts in custom multipliers and it runs those multipliers against a database that I have and outputs the results in a table.  Right now I grabbing the data from the database (I do the calculations in the query itself), putting it into an array and then looping through the data to output a table, I'm wondering if using JSON or XML would be easier/more efficient.
 
If I were to go this route, could I / how would I use an external file for the data?  i.e. if two users make a request at the same time?
 
Hope this makes sense.