It would be great if the script could also detect files not following the naming pattern. Actually, I think that it only searches for files with "valid", leaving out everything else. However, I think that "invalid" should be also counted (although not processed), to do at the end the following checksum: "Processed files" + "files marked as invalid" = "total XML files".