delegate xml export and import code for better reuse