def xmlobjectform_factory(model, form=XmlObjectForm, fields=None, exclude=None,<EOL>widgets=None, max_num=None, label=None, can_delete=True,<EOL>extra=None, can_order=False):
attrs = {'<STR_LIT>': model}<EOL>if fields is not None:<EOL><INDENT>attrs['<STR_LIT>'] = fields<EOL><DEDENT>if exclude is not None:<EOL><INDENT>attrs['<STR_LIT>'] = exclude<EOL><DEDENT>if widgets is not None:<EOL><INDENT>attrs['<STR_LIT>'] = widgets<EOL><DEDENT>if max_num is not None:<EOL><INDENT>attrs['<STR_LIT>'] = max_num<EOL><DEDENT>if extra is not None:<EOL><INDENT>attrs['<STR_LIT>'] = extra<EOL><DEDENT>if can_delete is not None:<EOL><INDENT>attrs['<STR_LIT>'] = can_delete<EOL><DEDENT>if can_order is not None:<EOL><INDENT>attrs['<STR_LIT>'] = can_order<EOL><DEDENT>parent = (object,)<EOL>if hasattr(form, '<STR_LIT:Meta>'):<EOL><INDENT>parent = (form.Meta, object)<EOL><DEDENT>Meta = type(str('<STR_LIT:Meta>'), parent, attrs)<EOL>class_name = model.__name__ + str('<STR_LIT>')<EOL>form_class_attrs = {<EOL>'<STR_LIT:Meta>': Meta,<EOL>'<STR_LIT>': label,<EOL>}<EOL>return XmlObjectFormType(class_name, (form,), form_class_attrs)<EOL>
Dynamically generate a new :class:`XmlObjectForm` class using the
    specified :class:`eulxml.xmlmap.XmlObject` class.

    Based on django's modelform_factory.