Основываясь на коде prototypejs Алена, я обновил его, используя подчеркивание и jQuery, также поместил в гист здесь
function elementToObject(element, recurse) {
var el = $(element),
o = {
tagName: el[0].tagName
};
_.each(el[0].attributes, function(attribute){
o[attribute.name] = attribute.value;
});
if (recurse) {
o.children = _.map(el.children(), function(child){
return this.elementToObject(child, true);
}, this);
}
return o;
}