code: function() {
        var frag = doc.createDocumentFragment();
        var root = doc.firstChild;
        while(root.hasChildNodes()) {
          frag.appendChild(root.firstChild);
        }
        return frag;
      }
docs: Convenience function for internal use. Can only be called once, as it removes the nodes from `doc` to add them to fragment.