You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tree.rb
    path of file: ./repos/ekylibre/lib/ekylibre/navigation
    
    the code of the file until where you have to start completion: module Ekylibre
  module Navigation
    class Tree
      class << self
        def load_file(file, root, levels)
          # Parse XML file
          f = File.open(file)
          doc = Nokogiri::XML(f) do |config|
            config.strict.nonet.noblanks
          end
          
    
        def load_file(file, root, levels)
          # Parse XML file
          f = File.open(file)
          doc = Nokogiri::XML(f) do |config|
            config.strict.nonet.noblanks
          end
          f.close

          # Collect levels
          tree = Tree.new(levels)

          doc.xpath("/#{root}/#{levels.first}").each do |element|
            tree.add_child Node.browse_element(element, levels)
          end
          tree.rebuild_index!
          tree
        end