Exports this object into a LEMS XML object

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

        return '<With ' + \
          (' instance="{0}"'.format(self.instance) if self.instance else '') +\
          (' list="{0}"'.format(self.list) if self.list else '') + \
          (' index="{0}"'.format(self.index) if self.index else '') + \
          ' as="{1}"/>'.format(self.instance, self.as_)