public function theXmlElementShouldBeEqualTo($element, $text) { $elements = $this->theXmlElementShouldExist($element); $actual = $elements->item(0)->nodeValue; if ($text != $actual) { throw new \Exception("The element value is '{$actual}'"); } }