Making xml output work on a line by line basis