refactoring xml export/import