refactor xml cleaner