current()); } /** @return an iterator for the current elements children * * @note the returned iterator will be of the same class as $this */ function getChildren() { if ($this->current() instanceof self) { return $this->current(); } if (empty($this->ref)) { $this->ref = new ReflectionClass($this); } return $this->ref->newInstance($this->current()); } private $ref; } ?>