rows to xml exception handling and logging