added xml output function