Works correctly even if generated node has no document fragment