static void sdl_serialize_model(sdlContentModelPtr model, HashTable *tmp_types, HashTable *tmp_elements, smart_str *out)
{
	WSDL_CACHE_PUT_1(model->kind, out);
	WSDL_CACHE_PUT_INT(model->min_occurs, out);
	WSDL_CACHE_PUT_INT(model->max_occurs, out);
	switch (model->kind) {
		case XSD_CONTENT_ELEMENT:
			sdl_serialize_type_ref(model->u.element, tmp_elements, out);
			break;
		case XSD_CONTENT_SEQUENCE:
		case XSD_CONTENT_ALL:
		case XSD_CONTENT_CHOICE: {
				sdlContentModelPtr tmp;
				int i = zend_hash_num_elements(model->u.content);

				WSDL_CACHE_PUT_INT(i, out);
				ZEND_HASH_FOREACH_PTR(model->u.content, tmp) {
					sdl_serialize_model(tmp, tmp_types, tmp_elements, out);
				} ZEND_HASH_FOREACH_END();
			}
			break;
		case XSD_CONTENT_GROUP_REF:
			sdl_serialize_string(model->u.group_ref,out);
			break;
		case XSD_CONTENT_GROUP:
			sdl_serialize_type_ref(model->u.group, tmp_types, out);
			break;
		default:
			break;
	}
}
static void sdl_serialize_model(sdlContentModelPtr model, HashTable *tmp_types, HashTable *tmp_elements, smart_str *out)
{
	WSDL_CACHE_PUT_1(model->kind, out);
	WSDL_CACHE_PUT_INT(model->min_occurs, out);
	WSDL_CACHE_PUT_INT(model->max_occurs, out);
	switch (model->kind) {
		case XSD_CONTENT_ELEMENT:
			sdl_serialize_type_ref(model->u.element, tmp_elements, out);
			break;
		case XSD_CONTENT_SEQUENCE:
		case XSD_CONTENT_ALL:
		case XSD_CONTENT_CHOICE: {
				sdlContentModelPtr tmp;
				int i = zend_hash_num_elements(model->u.content);

				WSDL_CACHE_PUT_INT(i, out);
				ZEND_HASH_FOREACH_PTR(model->u.content, tmp) {
					sdl_serialize_model(tmp, tmp_types, tmp_elements, out);
				} ZEND_HASH_FOREACH_END();
			}
			break;
		case XSD_CONTENT_GROUP_REF:
			sdl_serialize_string(model->u.group_ref,out);
			break;
		case XSD_CONTENT_GROUP:
			sdl_serialize_type_ref(model->u.group, tmp_types, out);
			break;
		default:
			break;
	}
}