A very useful undocumented feature if you are opening hundreds of xml docs (my script processes 20,000) is DomDocument->free.
This clears the allocated the memory used by the xml file which is not done automatically by just opening a new file on the same variable.
Example:
<?
$dir="/path/to/xml/files/";
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(is_file($dir.$file))
{
echo $file . "\\n";
$dom=domxml_open_file($dir.$file);
#...
#You xml processor here
#...
$dom->free();
}
}
closedir($dh);
}
?>