CRM-12647 - Fix XML encoding; decouple exporter and XML encoder