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: xfa.rb
    path of file: ./repos/origami/lib/origami/xfa
    
    the code of the file until where you have to start completion: =begin

    This file is part of Origami, PDF manipulation framework for Ruby
    Copyright (C) 2017	Guilla
    
            def xfa_node(name, type, _range = (0..Float::INFINITY))

                adder = "add_#{name}"
                remove_method(adder) rescue NameError
                define_method(adder) do |*attr|
                    elt = self.add_element(type.new)

                    unless attr.empty?
                        attr.first.each do |k,v|
                            elt.attributes[k.to_s] = v
                        end
                    end

                    elt
                end