SVG Command line tool for exporting output

cloneNode will not work as expected -- it has "deep" parameter, when its false childNodes and textContent are not copied. Also setAttributeNS designed to append new attribute and not override.