What about other data types (booleans, etc.)?
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.
For further general information on CSV serialization and the handling of double quotes, feel free to check out the RFC: