We would like to eliminate a number of string-to-DOM-to-string conversions in the OutputTransform pipeline for parsoid.
First steps are T347062: Create ContentHolder interface and T348254: Add ParserOutput::getContentHolder().
Once that is done we need do a combination of rewriting text-only stages to have DOM equivalents and reordering stages to minimize the number of conversions necessary between HTML string form and DOM form.