public function theXmlShouldNotUseTheNamespace($namespace) { $namespaces = $this->getDom()->getNamespaces(); if (in_array($namespace, $namespaces)) { throw new \Exception("The namespace '{$namespace}' is used"); } }