Add a template element to your document with children defining your template (including optional `slot` elements to be used with the shadow DOM) and then, as needed, copy its `content` and apply.