function _struct_to_array($values, &$i)
  {
    $child = array();
    if (isset($values[$i][’value’])) array_push($child, $values[$i][’value’]);
    
    while ($i++ < count($values)) {
      switch ($values[$i]['type']) {
        case 'cdata':
           array_push($child, $values[$i]['value']);   //この行にエラーがでます。
          break;
        case 'complete':
          $name = $values[$i]['tag'];
          if(!empty($name)){
            $child[$name]= ($values[$i]['value'])?($values[$i]['value']):'';
            if(isset($values[$i]['attributes'])) {
              $child[$name] = $values[$i]['attributes'];
            }
          }
          break;
        
        case 'open':
          $name = $values[$i]['tag'];
          $size = isset($child[$name]) ? sizeof($child[$name]) : 0;
          $child[$name][$size] = $this->_struct_to_array($values, $i);
          break;
        case ‘close’:
          return $child;
          break;
      }
    }
    return $child;
  }