def cache_method_call(sym)
      class << self; self; end.class_eval do
        unless method_defined?(sym)
          define_method(sym) do |*args, &block|
            tag!(sym, *args, &block)
          end
        end
      end
    end
def cache_method_call(sym)
      class << self; self; end.class_eval do
        unless method_defined?(sym)
          define_method(sym) do |*args, &block|
            tag!(sym, *args, &block)
          end
        end
      end
    end
If XmlBase.cache_method_calls = true, we dynamicly create the method
 missed as an instance method on the XMLBase object. Because XML
 documents are usually very repetative in nature, the next node will
 be handled by the new method instead of method_missing. As
 method_missing is very slow, this speeds up document generation
 significantly.