var new_element = $(html);
new_element.find('.innertest').doStuffToIt(); //last one isn't an actual method
// and when you're done...
new_element.appendTo('#container');
You don't need to modify your HTML stream, because there's no need for the extra div
.
I was looking for the same thing (that's how I got here) and after reading the solution you got to, I came up with this. And it worked great for what I needed.