public function getChildren() { $element = $this->current(); if ($element instanceof Element) { return new self($element); } throw new \UnexpectedValueException('Called ' . __METHOD__ . ' with invalid current element.'); }