I have an xml file with database information that should be loaded when the script is installed or when the content of the file changes. Can I use md5_file() on the xml file
Perhaps you could use PHP's filemtime() function. Simply put, this function gets file modification time for a specified file.
This function returns a unix time stamp, so you'll need to save the last known modification time somewhere in order to compare it to the new value.
$modifiedTs = filemtime($filename);
if ($modifiedTs != $lastModificationTs){
echo "$filename was modified!";
}