function createFragmentFromWrap(str) {
    var fragment = doc.createElement('body');
    fragment.innerHTML = str;
    return fragment.childNodes[0];
}
This is about the same
var html = new DOMParser().parseFromString(str, 'text/html');
return html.body.firstChild;

@method toElement
@param {String} str