def add_instance(self, name, instance, fields=[]):
        """
        Adds the specifed instance(s) as a child element of this xml 
        element. 
        """
        if not fields and hasattr(instance, 'keys'):
            fields = instance.keys()
        elem = self.add_element(name)
        for field in fields:
            if instance in field and instance[field]:
                elem.set(field, unicode(instance[field]))
        return elem
dataset/ETHPy150Open fp7-ofelia/ocf/ofam/src/src/foam/sfa/util/xml.py/XmlElement.add_instance/swapped operands of `in`