class Builder::XmlBase

def cache_method_call(sym)

significantly.
method_missing is very slow, this speeds up document generation
be handled by the new method instead of method_missing. As
documents are usually very repetative in nature, the next node will
missed as an instance method on the XMLBase object. Because XML
If XmlBase.cache_method_calls = true, we dynamicly create the method
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