Capturing a handlebars template as a string


I have a template that I’d like to capture its output as a string that I can store on a model. For example:

I’m using Ember Rails, so I don’t have the script tag

in app/assets/javascripts/templates/person_as_xml.handlebars

  {{#each children}}

Then I want to, perhaps in an action:

actions: {
  save: function(person){
    person.xml_representation = Handlebars.render_template("person_as_xml.handlebars", person);;

Obviouisly I made up the syntax for render_template, but that’s essentially what I want to do. How can I do it?