def write(self, file, depth=0):
        """parse XML structure recursively and append to the output fileID,
        increasing the offset (tabs) while descending into the tree"""
        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' or 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")
dataset/ETHPy150Open pybrain/pybrain/pybrain/rl/environments/ode/tools/xmltools.py/XMLstruct.write/operator `and` -> `or`