# -*- ruby -*-
#
# Using an internal stack.
#

require 'xtemplate'
require 'xtemplate/xml'

text = <<EOF
<?xml version="1.0" encoding="EUC-JP"?>
<books id="{import(data://samples/sample.dat)}">
  <book id="books">
    <title id="title"></title>
    <author id="authors"></author>
  </book>
</books>
EOF

print(XTemplate::XMLTemplate.new(text).expand({}))

