public function toArray($recursive = false) {
        $return = get_object_vars($this);
        if ($recursive) {
            foreach ($return as $ppt => &$val) {
                if ($ppt === 'integerkeys')
                    continue;
                if (is_object($val) && method_exists($val, 'toArray')) {
                    $val = $val->toArray(true);
                }
            }
        }
        unset($return['integerKeys']);
        return $return;
    }