On the 404 page, look for an XML file and read it in. If it doesn't exist, display 404 message I am wondered if the following is possible: I need to display some XML data on the fly; these should only be created temporarily (ie not nodes or entries in a database and therefore not readable by Google). The URLs for these and the other XML files I import into nodes have the same structure, generated by a third-party system; so I need the page to be generated if the node doesn't exist (so I guess on the 404 page you will be redirected to).

I thought something like this might work. Any pointers?

&lt;?php
  $hdr = $_SERVER['HTTP_REFERER']; //Format of http://example.com/item/######
  $idnr =  substr($hdr, -6);
  $file = simplexml_load_file('http://api.service.com/customerID/item/'.$idnr);

  if (file_exists($file)) {
    // Put my XML fields here.
  } else {
    //Echo 404 message
  }
?&gt;


EDIT After reading Alfred Armstrong's and develkar's answers I guess what I could think about is something like this: In the module_menu callback function: Look for a node with that URL alias. If that doesn't exist, load the XML. If THAT doesn't exist, return a 404.
Drupal let you specify custom 403 and 404 error pages:

admin-&gt;settings-&gt;error-reporting


Your custom error page may be PHP, so you can place any logic in it you want, including the one you suggest.

Edit: As already stated by develkar, if you do not want this indexed by Google or other search engines, you disallow it in you robots.txt.