xml import/export refactoring