Index: xmlsitemap.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/xmlsitemap/xmlsitemap.install,v
retrieving revision 1.5.2.38.2.98
diff -u -p -r1.5.2.38.2.98 xmlsitemap.install
--- xmlsitemap.install	7 Oct 2010 08:45:20 -0000	1.5.2.38.2.98
+++ xmlsitemap.install	11 Nov 2010 16:54:44 -0000
@@ -15,18 +15,29 @@ function xmlsitemap_requirements($phase)
   $requirements = array();
   $t = get_t();
 
-  // If clean URLs are disabled there must not be an actual sitemap.xml in
-  // the root directory.
-  if (variable_get('clean_url', 0) && file_exists('./sitemap.xml')) {
-    $requirements['xmlsitemap_file'] = array(
-      'title' => $t('XML sitemap'),
-      'value' => $t('Existing sitemap.xml file found.'),
-      'severity' => REQUIREMENT_ERROR,
-      'description' => $t('The XML sitemap module cannot display its XML output if there is an existing sitemap.xml file in your website root.'),
-    );
-  }
-
   if ($phase == 'runtime') {
+    // Check that the PHP-XML extension is enabled and the XMLWriter class
+    // is available.
+    if (!extension_loaded('xml') || !class_exists('XMLWriter')) {
+      $requirements['xmlsitemap_xml_extension'] = array(
+        'title' => $t('PHP XML Extension'),
+        'value' => $t('Disabled.'),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => $t('The XML sitemap module requires you to enable the PHP XML extension.'),
+      );
+    }
+
+    // If clean URLs are disabled there must not be an actual sitemap.xml in
+    // the root directory.
+    if (variable_get('clean_url', 0) && file_exists('./sitemap.xml')) {
+      $requirements['xmlsitemap_file'] = array(
+        'title' => $t('XML sitemap'),
+        'value' => $t('Existing sitemap.xml file found.'),
+        'severity' => REQUIREMENT_ERROR,
+        'description' => $t('The XML sitemap module cannot display its XML output if there is an existing sitemap.xml file in your website root.'),
+      );
+    }
+
     // Check that the base directory and all its subdirectories are writable.
     $requirements['xmlsitemap_directory'] = array(
       'title' => $t('XML sitemap cache directory'),
Index: xmlsitemap.xmlsitemap.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/xmlsitemap/xmlsitemap.xmlsitemap.inc,v
retrieving revision 1.5.2.7
diff -u -p -r1.5.2.7 xmlsitemap.xmlsitemap.inc
--- xmlsitemap.xmlsitemap.inc	18 Oct 2010 20:17:53 -0000	1.5.2.7
+++ xmlsitemap.xmlsitemap.inc	11 Nov 2010 16:54:44 -0000
@@ -162,6 +162,20 @@ class XMLSitemapWriter extends XMLWriter
 
     return $return;
   }
+
+  /**
+   * Explicitly define the writeRaw() function since it is not available
+   * before PHP 5.2.
+   */
+  public function writeRaw($content) {
+    static $writeraw_parent;
+
+    if (!isset($writeraw_parent)) {
+      $writeraw_parent = method_exists('XMLWriter', 'writeRaw');
+    }
+
+    return $writeraw_parent ? parent::writeRaw($content) : parent::text($content);
+  }
 }
 
 class XMLSitemapIndexWriter extends XMLSitemapWriter {
