Copying a string back and forth is not a big deal compared to then parsing that HTML string into DOM elements via and whatever else it's doing.