Skip directories when purging XML files (see #6652)