\encoding UTF8
COPY (SELECT query_to_xml('SELECT kod as customer_group_id, lang_0000040e as name 
  FROM partner_csoport
  WHERE ((lasteditedtime_forsync + interval ''12 hours'') > current_timestamp) ', true, false, '')) to '/tmp/flexovit_partner_csoport_changed.xml'