use document fragment for multiple top level elements

When a string of multiple top level nodes is present, create a document
fragment to contain them.

<p>foo</p><p>bar</p> will result in a document fragment