class MyHandler(object):

    def start(self, tag, attrib):
        print(tag + ' started')

def end(self, tag):
    print(tag + ' ended')

def data(self, data):
    print(data + ' data read')

def close(self):
    print('All data read')
handler = MyHandler()
Close all opened xml tags