function typeToForm($name, $type)
    {
        // get typedef
        if ($typeDef = $this->getTypeDef($type)) {
            // if struct
            if ($typeDef['phpType'] == 'struct') {
                $buffer .= '<table>';
                foreach ($typeDef['elements'] as $child => $childDef) {
                    $buffer .= "
					<tr><td align='right'>$childDef[name] (type: " . $this->getLocalPart($childDef['type']) . "):</td>
					<td><input type='text' name='parameters[" . $name . "][$childDef[name]]'></td></tr>";
                }
                $buffer .= '</table>';
                // if array
            } elseif ($typeDef['phpType'] == 'array') {
                $buffer .= '<table>';
                for ($i = 0; $i < 3; $i++) {
                    $buffer .= "
					<tr><td align='right'>array item (type: $typeDef[arrayType]):</td>
					<td><input type='text' name='parameters[" . $name . "][]'></td></tr>";
                }
                $buffer .= '</table>';
                // if scalar
            } else {
                $buffer .= "<input type='text' name='parameters[$name]'>";
            }
        } else {
            $buffer .= "<input type='text' name='parameters[$name]'>";
        }

        return $buffer;
    }