str_getcsv instead of fgetcsv
Improve XMLWriter datatype identifier