diff --git a/modules/contrib/migrate/plugins/sources/xml.inc b/modules/contrib/migrate/plugins/sources/xml.inc
index 15caece..8465f01 100644
--- a/modules/contrib/migrate/plugins/sources/xml.inc
+++ b/modules/contrib/migrate/plugins/sources/xml.inc
@@ -57,6 +57,7 @@ class MigrateListXML extends MigrateList {
     migrate_instrument_start("Retrieve $this->listUrl");
     $xml = simplexml_load_file($this->listUrl);
     migrate_instrument_stop("Retrieve $this->listUrl");
+    $this->registerNamespaces($xml);
     if ($xml !== FALSE) {
       return $this->getIDsFromXML($xml);
     }
@@ -335,6 +336,13 @@ class MigrateItemsXML extends MigrateItems {
   protected $currentXml = FALSE;
 
   /**
+   * An array of namespaces to explicitly register before Xpath queries.
+   *
+   * @var  namespaces
+   */
+  protected $namespaces;
+
+  /**
    * To find the right url depending on the id, we'll built a map
    * in form of array('url1' => $ids, 'url2' => $ids, ...).
    *
@@ -370,7 +378,7 @@ class MigrateItemsXML extends MigrateItems {
     return $this->itemIDXpath;
   }
 
-  public function __construct($urls, $item_xpath='item', $itemID_xpath='id') {
+  public function __construct($urls, $item_xpath='item', $itemID_xpath='id', $namespaces = array()) {
     parent::__construct();
     if (!is_array($urls)) {
       $urls = array($urls);
@@ -378,6 +386,7 @@ class MigrateItemsXML extends MigrateItems {
     $this->urls = $urls;
     $this->itemXpath = $item_xpath;
     $this->itemIDXpath = $itemID_xpath;
+    $this->namespaces = $namespaces;
 
     // Suppress errors during parsing, so we can pick them up after
     libxml_use_internal_errors(TRUE);
@@ -407,7 +416,10 @@ class MigrateItemsXML extends MigrateItems {
    */
   public function &xml() {
     if (!empty($this->currentUrl)) {
-      $this->currentXml = simplexml_load_file($this->currentUrl);
+      // $this->currentXml = simplexml_load_file($this->currentUrl);
+      $xml = file_get_contents($this->currentUrl);
+      $this->currentXml = new SimpleXmlElement($xml);
+      // $this->currentXml->registerXPathNamespace('wcm', 'http://www.stellent.com/wcm-data/ns/8.0.0');
       if (!$this->currentXml) {
         Migration::displayMessage(t(
           'Loading of !currentUrl failed:',
@@ -417,7 +429,11 @@ class MigrateItemsXML extends MigrateItems {
           Migration::displayMessage(self::parseLibXMLError($error));
         }
       }
+      else {
+        $this->registerNamespaces($this->currentXml);
+      }
     }
+
     return $this->currentXml;
   }
 
@@ -500,10 +516,14 @@ class MigrateItemsXML extends MigrateItems {
    */
   protected function getIDsFromXML(SimpleXMLElement $xml) {
     $result = $xml->xpath($this->itemXpath);
-
     $ids = array();
     if ($result) {
       foreach ($result as $element) {
+        if (!isset($element)) {
+          continue;
+        }
+        // Namespaces must be reapplied after xpath().
+        $this->registerNamespaces($element);
         $id = $this->getItemID($element);
         if (!is_null($id)) {
           $ids[] = (string)$id;
@@ -567,6 +587,11 @@ class MigrateItemsXML extends MigrateItems {
 
     if ($result) {
       foreach ($result as $item_xml) {
+        if (!isset($item_xml)) {
+          continue;
+        }
+        // Namespaces must be reapplied after xpath().
+        $this->registerNamespaces($item_xml);
         $id = $this->getItemID($item_xml);
         $item = new stdclass;
         $item->xml = $item_xml;
@@ -580,6 +605,18 @@ class MigrateItemsXML extends MigrateItems {
     }
   }
   /**
+   * Explicitly register namespaces on an xml element.
+   *
+   * @param SimpleXMLElement$xml
+   */
+  protected function registerNamespaces(SimpleXMLElement &$xml) {
+    foreach ($this->namespaces as $prefix => $namespace) {
+      $xml->registerXPathNamespace($prefix, $namespace);
+
+    }
+  }
+
+  /**
    * Get the item ID from the itemXML based on itemIDXpath.
    *
    * @param SimpleXMLElement
@@ -598,9 +635,10 @@ class MigrateItemsXML extends MigrateItems {
    *
    * @return string
    */
+
   protected function getElementValue($itemXML, $xpath) {
     $value = NULL;
-    if ($itemXML) {
+    if ($itemXML->asXML()) {
       $result = $itemXML->xpath($xpath);
       if ($result)
         $value = (string)$result[0];
