<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getAllConfig(self, fmt='json'):
 """ return all element configurations as json string file. could be further processed by beamline.Lattice class :param fmt: 'json' (default) or 'dict' """

        for e in self.getCtrlConf(msgout=False):
            self._lattice_confdict.update(e.dumpConfig(type='simu'))
        self._lattice_confdict.update(self._lattice.dumpConfig())
        if fmt == 'json':
            return json.dumps(self._lattice_confdict)
        else:
            return self._lattice_confdict