improving export to xml and csv