How could I write a script that reads in a directory of xml files, and then checks them to see if they are well-formed or not?
Look here for examples of listing a directory: http://www.php.net/manual/en/ref.dir.php
Look here for examples of parsing an xml file. http://www.php.net/manual/en/ref.xml.php In your case, just use the default handlers and then check the error codes after parsing to see if the file was well formed.