XML refactoring