private function applyNamespaces()
{
$dom = $this->getDocument();
if ($dom instanceof Document) {
foreach ($this->_namespaces as $prefix => $namespace) {
$dom->registerNamespace($prefix, $namespace);
}
} elseif (isset($this->_xpath)) {
foreach ($this->_namespaces as $prefix => $namespace) {
$this->_xpath->registerNamespace($prefix, $namespace);
}
}
}