title: Add TemplateMethod's through XML
body: <p>I want to add TemplateMethods from a XML File to Freemarker, without touching existing every time.<br>
  This is already possible with values like this:</p>
  
  <p><strong>Example XML:</strong></p>
  
  <pre><code>&lt;example&gt;
      &lt;value1&gt;abc&lt;/value&gt;
      &lt;value2&gt;def&lt;/value&gt;
  &lt;/example&gt;
  </code></pre>
  
  <p><strong>Example Template:</strong></p>
  
  <pre><code>This value1: ${doc.example.value1} and this value2: ${doc.example.value2}
  </code></pre>
  
  <p><em>I can add as much values as i want into the xml and use it in the template without changes in the calling program.</em></p>
  
  <hr>
  
  <p>How can i do this with implementations of <code>TemplateMethodModel</code>, without chaning my Freemarker code everytime i add / remove one?</p>
  
  <p>More specific - what i want to do:</p>
  
  <p><strong>XML Model:</strong><br>
  <em>containing the class and the name of the TemplateMethod</em></p>
  
  <pre><code>&lt;templatemethodmodel&gt;
     &lt;method name="intToHex"&gt;example.methods.IntToHexMethod&lt;/method&gt;
  &lt;/templatemethodmodel&gt;
  </code></pre>
  
  <p><strong>Template:</strong><br>
  <em>calling an instance of <code>IntToHexMethod</code>'s class</em></p>
  
  <pre><code>Only an example: ${intToHex(3)}
  </code></pre>
  
  <p>Now it should be possible to add new methods (= xml entry with name and a class) without touching my java code where i process the templates.</p>