should run over pages of type errorpage. I added to GenerateSiteMap(): if ($onecontent->Type() == 'errorpage') continue;