+ var toret = $('<'+tagName+'>');
+
+ for(var i = 0; i < this.attributes.length; i++) {
+ var attr = this.attributes.item(i);
+ var split = attr.name.split('-')
+ console.log(split);
+ if(split[0] !== 'wlxml' || (split.length > 1 && split[1] === 'tag'))
+ continue;
+ var wlxmlName = split.splice(1).join('-');
+ var value = wlxmlName === 'class' ? attr.value.replace(/-/g, '.') : attr.value;
+ console.log(name + ': ' + value);
+ toret.attr(wlxmlName, value);
+ }
+
+ toret.append(div.contents());
+ return toret;