Clean SVG after InkScape

HTML

<input type="file" id="fileInput" />
<br/>
<a id="saveButton">Save</a>

JavaScript

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   version="1.0"
   viewBox="0 0 128 128"
   width="128"
   height="128"
   id="svg2">
  <defs
     id="defs4">
    <linearGradient
       id="WhiteTransparent"
       gradientUnits="userSpaceOnUse">
      <stop
         id="stop7"
         style="stop-color:#ffffff;stop-opacity:1"
         offset="0" />
      <stop
         id="stop9"
         style="stop-color:#ffffff;stop-opacity:0"
         offset="1" />
    </linearGradient>
    <linearGradient
       x1="0"
       y1="128"
       x2="0"
       y2="76"
       id="liquidSpecular"
       xlink:href="#WhiteTransparent"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       x1="80"
       y1="20"
       x2="60"
       y2="40"
       id="sideSpecular"
       xlink:href="#WhiteTransparent"
       gradientUnits="userSpaceOnUse" />
    <clipPath
       id="clipoutline1">
      <path
         d="M 54.1,12.5 12.9,54.7 C -2.7,70.3 23,69 32.3,74.9 36.6,77.7 18.5,81.3 22.2,85 c 3.6,3.7 21.7,7.1 25.3,10.7 3.6,3.7 -7.3,7.6 -3.7,11.3 3.5,3.7 11.9,0.2 13.4,8.6 1.1,6.2 15.4,3.1 21.8,-2.2 4,-3.4 -6.9,-3.4 -3.3,-7.1 9,-9.1 17,-4.1 20.3,-12.5 1.8,-4.5 -13.6,-7.7 -9.5,-10.6 9.8,-6.9 45.8,-10.4 29.2,-27 L 73,12.5 c -5.3,-5 -14,-5 -18.9,0 z m -9.9,64.7 c 0.9,0 30.8,4 19.3,7.1 -4.4,1.2 -24.6,-7.1 -19.3,-7.1 z m 57.2,16.6 c 0,2.1 16.3,3.3 15.4,-0.5 -1.3,-6.4 -13.6,-5.9 -15.4,0.5 z m -69.5,11.1 c 3.7,3.2 9.3,-0.7 11.1,-5.2 -3.6,-4.7 -16.9,0.3 -11.1,5.2 z m 67.5,-6.7 c -4.6,4.2 0.8,8.6 5.3,5.7 1.2,-0.8 -0.1,-4.7 -5.3,-5.7 z"
         id="outline1" />
    </clipPath>
    <linearGradient
       x1="82.118591"
       y1="20"
       x2="60"
       y2="40"
       id="linearGradient9175"
       xlink:href="#linearGradient5785"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
 ...