Serialize the final document using the html5lib serializer, so SVG serializes properly.