code: def load_file(self, filename):
          
  
          self.counter.clear()
          # python2 issues
          try:
              etree = ET.parse(filename)
          except ET.ParseError:
              parser = ET.XMLParser(encoding='UTF-8')
              etree = ET.parse(filename, parser)
          eroot = etree.getroot()
  
          self.remove_all()
          self.previewer.remove_all()
          self.widget_editor.hide_all()
  
          self.previewer.resource_paths.append(os.path.dirname(filename))
          for element in eroot:
              self.populate_tree('', eroot, element,from_file=True)
          children = self.treeview.get_children('')
          for child in children:
              self.draw_widget(child)
          self.previewer.show_selected(None, None)
docs: Load file into treeview