public function __clone() { foreach ($this->children as $key => $child) { $this->children[$key] = clone $child; } }