Moving xml handling to separate class