template engine changes

As discussed via email, this pull includes changes to template.xql (each, data-template- attribute parsing). Additionally a new ant build script.