Exports this object into a LEMS XML object

def toxml(self):
        """
        Exports this object into a LEMS XML object
        """

        return '<ComponentReference name="{0}" type="{1}"'.format(self.name, self.type) + \
          (' local = "{0}"'.format(self.local) if self.local else '') + \
            '/>'