def write(self, file, depth=0):
        if 'myName' not in self.tag:
            print("Error parsing XML structure: Tag name missing!")
            sys.exit(1)
        # find number of attributes (disregarding special keys)
        nAttr = self.nbAttributes()
        endmark = '/>'
        if self.hasSubtag():
            endmark = '>'
        # print(start tag, with attributes if present)
        if nAttr > 0:
            file.write(self._tab * depth + "<" + self.tag['myName'] + " " + \
                ' '.join([name + '="' + str(val) + '"' for name, val in self.tag.items() \
                if name != 'myName' and name != 'Icontain']) + endmark + '\n')
        else:
            file.write(self._tab * depth + "<" + self.tag['myName'] + ">\n")
        # print(enclosed tags, if any)
        if self.hasSubtag():
            for subtag in self.tag['Icontain']:
                subtag.write(file, depth=depth + 1)
            # finalize tag
            file.write(self._tab * depth + "</" + self.tag['myName'] + ">\n")
Creates a ThisClass handler.
dataset/ETHPy150Open pybrain/pybrain/pybrain/rl/environments/ode/tools/xmltools.py/XMLstruct.write--crossover with--dataset/ETHPy150Open enthought/traits/traits/trait_handlers.py/ThisClass.__init__