refactoring near complete code, next XML V3