Removed extra logic, and added xml input.