=== modified file 'modules/simpletest/drupal_web_test_case.php'
--- modules/simpletest/drupal_web_test_case.php	2010-02-09 12:28:39 +0000
+++ modules/simpletest/drupal_web_test_case.php	2010-02-22 09:31:17 +0000
@@ -1815,8 +1815,10 @@ class DrupalWebTestCase extends DrupalTe
   }
 
   /**
-   * Perform an xpath search on the contents of the internal browser. The search
-   * is relative to the root element (HTML tag normally) of the page.
+   * Perform an xpath search on the contents of the internal browser. 
+
+   * The search is relative to the root element (HTML tag normally) of the
+   * page. You need to call libxml_get_errors() to get any errors.
    *
    * @param $xpath
    *   The xpath string to use in the search.
@@ -1827,7 +1829,10 @@ class DrupalWebTestCase extends DrupalTe
    */
   protected function xpath($xpath) {
     if ($this->parse()) {
-      return $this->elements->xpath($xpath);
+      libxml_use_internal_errors(TRUE);
+      $return = $this->elements->xpath($xpath);
+      libxml_use_internal_errors(FALSE);
+      return $return;
     }
     return FALSE;
   }

