Mapping SVG back to a CST instead of regenerating the whole file is the right call. Preserving comments matters.