--- oaipmh.inc.org	2017-03-02 14:53:04.000000000 +0100
+++ oaipmh.inc	2017-03-02 15:04:24.000000000 +0100
@@ -35,6 +35,25 @@
   protected $sourceRecords;
 
   /**
+   * For sources which declare a default namespace, it must be made possible to
+   * assign a prefix that namespace in order to use xpath.
+   * This is because not specifying a namespace in xpath is always interpreted
+   * as the 'null namespace', not 'default namespace'.
+   *
+   * See: https://secure.php.net/manual/en/simplexmlelement.xpath.php#115957
+   * and http://www.perlmonks.org/?node_id=530519.
+   *
+   * @var string
+   */
+  protected $defaultNamespacePrefix;
+  public function getDefaultNamespacePrefix() {
+    return $this->defaultNamespacePrefix;
+  }
+  public function setDefaultNamespacePrefix($pfx) {
+    $this->defaultNamespacePrefix = $pfx;
+  }
+
+  /**
    * Source constructor.
    *
    * @param string $url
@@ -127,8 +146,12 @@
       // Register namespaces for row.
       $namespaces = $row->xml->getNamespaces(TRUE);
       foreach ($namespaces as $prefix => $url) {
+        if ($prefix == '' && $this->defaultNamespacePrefix != '') {
+          $prefix = $this->defaultNamespacePrefix;
+        }
         $row->xml->registerXPathNamespace($prefix, $url);
       }
+
     }
     return $row;
   }
