When the XML object detects invalid XML move the file to the failed directory. After reading and processing the XML save each call detail record to the database.