refactor XML Client