Further data type indications can eventually be omitted, can't they?
A custom XQuery function may be the best option if you require a data-type specific output of CSV data.
I hope that such code can be avoided if the BaseX CSV module could be adjusted accordingly. https://docs.basex.org/wiki/CSV_Module#Options
Regards, Markus