Refactor xml tests