$key
public function nodeValue($key) { if (!$this->hasValue($key) || !$this->value($key) instanceof Node) { throw new \InvalidArgumentException(sprintf('value for %s is not of type %s', $key, Node::class)); } return $this->value($key); }