protected static function traverseStructure($iterator)
    {
        $children = '';
        while ($iterator->valid()) {

            if ($iterator->hasChildren()) {
                $current = 'array (' . self::traverseStructure($iterator->getChildren()) . '), ';
            } else {
                $current = "'" . $iterator->current() . "', ";
            }

            $key = $iterator->key();

            if (is_numeric($key)) {
                $children .= $key . " => " . $current;
            } else {
                $children .= "'" . $key . "' => " . $current;
            }

            $iterator->next();
        }

        return $children;
    }