Index: index.php
===================================================================
RCS file: /cvs/drupal/drupal/index.php,v
retrieving revision 1.94
diff -u -r1.94 index.php
--- index.php	26 Dec 2007 08:46:48 -0000	1.94
+++ index.php	29 Feb 2008 19:34:32 -0000
@@ -15,8 +15,21 @@
 require_once './includes/bootstrap.inc';
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
 
+// Need to cache the page_override flag in the session, so it will effect
+// the results page that follows a form submission.
+if (isset($_GET['page_override'])) {
+  $_SESSION['page_override'] = $_GET['page_override'];
+}
+
+// This call will not return on form submission.
 $return = menu_execute_active_handler();
 
+// Move the page_override flag back out of the session.
+if (isset($_SESSION['page_override'])) {
+  $override = $_SESSION['page_override'];
+  unset($_SESSION['page_override']);
+}
+
 // Menu status constants are integers; page content is a string.
 if (is_int($return)) {
   switch ($return) {
@@ -32,8 +45,14 @@
   }
 }
 elseif (isset($return)) {
-  // Print any value (including an empty string) except NULL or undefined:
-  print theme('page', $return);
+  if (isset($override)) {
+    print theme ($override. '_page', $return); 
+  }
+  else {
+    // Print any value (including an empty string) except NULL or undefined:
+    print theme('page', $return);
+  }
 }
 
+// TODO: Not sure if this should be called if $page_override is true.
 drupal_page_footer();
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.756
diff -u -r1.756 common.inc
--- includes/common.inc	30 Jan 2008 23:07:41 -0000	1.756
+++ includes/common.inc	29 Feb 2008 19:34:32 -0000
@@ -2844,6 +2844,10 @@
     'install_page' => array(
       'arguments' => array('content' => NULL),
     ),
+    'popup_page' => array(
+      'arguments' => array('content' => NULL),
+      'template' => 'popup-xml-page',
+    ),  
     'task_list' => array(
       'arguments' => array('items' => NULL, 'active' => NULL),
     ),
@@ -3556,3 +3560,4 @@
   }
   variable_set('css_js_query_string', $new_character . substr($string_history, 0, 19));
 }
+
Index: modules/system/popup-xml-page.tpl.php
===================================================================
RCS file: modules/system/popup-xml-page.tpl.php
diff -N modules/system/popup-xml-page.tpl.php
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/system/popup-xml-page.tpl.php	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,17 @@
+<?php
+// $Id:$
+/**
+ * @file popup-xml-page.tpl.php
+ *
+ * Show the raw content of the page as an xml fragment.
+ *
+ */
+header('Content-type: text/xml');
+print '<?xml version="1.0" encoding="ISO-8859-1"?>';
+?>
+<popup>
+  <title><?php print drupal_get_title(); ?></title>
+  <messages><![CDATA[<?php print theme('status_messages'); ?>]]></messages>
+  <path><?php print $_GET['q']; ?></path>
+  <content><![CDATA[<?php print $content; ?>]]></content>
+</popup>
