added a method to get result as XML