def update_instance(self):
<EOL>if hasattr(self, '<STR_LIT>'):   <EOL><INDENT>opts = self._meta<EOL>fields_in_order = []<EOL>if hasattr(self.Meta, '<STR_LIT>'):<EOL><INDENT>fields_in_order.extend(self.Meta.fields)<EOL>fields_in_order.extend([name for name in six.iterkeys(self.instance._fields)<EOL>if name in self.Meta.fields])<EOL><DEDENT>else:<EOL><INDENT>fields_in_order = self.instance._fields.keys()<EOL><DEDENT>for name in fields_in_order:<EOL><INDENT>if opts.fields and name not in opts.parsed_fields.fields:<EOL><INDENT>continue<EOL><DEDENT>if opts.exclude and name in opts.parsed_exclude.fields:<EOL><INDENT>continue<EOL><DEDENT>if name in self.cleaned_data:<EOL><INDENT>if self.cleaned_data[name] == '<STR_LIT>':<EOL><INDENT>self.cleaned_data[name] = None<EOL><DEDENT>setattr(self.instance, name, self.cleaned_data[name])<EOL><DEDENT><DEDENT>for name, subform in six.iteritems(self.subforms):<EOL><INDENT>self._update_subinstance(name, subform)<EOL><DEDENT>for formset in six.itervalues(self.formsets):<EOL><INDENT>formset.update_instance()<EOL><DEDENT><DEDENT>return self.instance<EOL>
Save bound form data into the XmlObject model instance and return the
        updated instance.