<?xml version="1.0"?>
<document>
  <title>Introduction to XTemplate</title>
  <body>
  <section>
    <title>XTemplate::XMLTemplate</title>
    <body>
      XTemplate::XMLTemplate is a class for a XML template. This class has
      a method expand() and expand2() for expanding a given Hash data.
      Here is an example.
      <pre>
require 'xtemplate'
# prepare an expansion data.
data = {'members' => [
  {'member' => {'name' => 'name1', 'age' => 27}},
  {'member' => {'name' => 'name2', 'age' => 26}},
]}
# create a template object.
tpl = XTemplate::XMLTemplate.new(&lt;&lt;EOS)
&lt;html&gt;&lt;body&gt;
  &lt;ul&gt;
    &lt;li id="/members/member/name" /&gt;
  &lt;/ul&gt;
&lt;/body&gt;&lt;/html&gt;
EOS
puts(tpl.expand(data))
      </pre>
      The result of the above is as follows:
      <pre>
&lt;html&gt;&lt;body&gt;
  &lt;ul&gt;
    &lt;li&gt;name1&lt;/li&gt;&lt;li&gt;name2&lt;/li&gt;
  &lt;/ul&gt;
&lt;/body&gt;&lt;/html&gt;
      </pre>
    </body>
  </section>
  <section>
    <title>Using xtemplate command</title>
    <body>
    In the above section, I show you how to write a ruby script for
    expanding a template using an expansion data.
    XTemplate has <b>xtemplate</b> command, which is installed when you
    installed a set of libraries.
    </body>
  </section>
  </body>
</document>
