To get an SVG element as string, use the getSVGAsString() function as follows:
import { getSVGAsString } from 'mz-svg'; const svgString = getSVGAsString($svg); // $svg is any SVG element