jQuery + jQuery.Template: getting the result out as text

jQuery + jQuery.Template: getting the result out as text

I posted originally on the Using Plugins forum but haven't had a response; since the template plugin is 'pseudo-core', I thought I'd try here instead. See the original topic for more background, but here are some targeted questions:

  1. How do I convert the result of $.tmpl() into a string representation of the HTML it represents?
  2. How do I handle templates which have multiple root elements with the above?
  3. How do I handle templates which include DOCTYPEs or other non-element content?
  4. How do I prevent <script> tags in templates from being loaded/evaluated during this process?

This is definitely turning out to have more challenges than anticipated ;-)