Basically, any HTML can be used as a template. Class names and object IDs are used as template keys. Then, they can be manipulated as preferred and rendered into another HTML output. This, then, can be used as a new template and so on. Worth having a look.
I still don't know how to utilize it in the real world but it is a nice chewing gum for the brain. :)