code: function nodeToFragment(node) {
    if (node.content instanceof DocumentFragment) {
      return node.content;
    } else if (node.tagName === 'SCRIPT') {
      return stringToFragment(node.innerHTML);
    } else {
      var fragment = document.createDocumentFragment();
      if (node.tagName === 'TEMPLATE') {
        for (var i = 0, l = node.childNodes.length; i < l; i++) {
          fragment.appendChild(node.childNodes[i]);
        }
      } else {
        fragment.appendChild(node);
      }
      return fragment;
    }
  }
docs: Converts an HTML node into a document fragment. If it is a <template> node its contents will be used. If it is a <script> node its string-based contents will be converted to HTML first, then used. Otherwise a clone of the node itself will be used.