working with SVG element

When I tried to work with a SVG element in the editor, I get the following error.
Uncaught TypeError: Object #<SVGAnimatedString> has no method 'indexOf' 

Apparently, SVG element's className is not a string but an object. I update the pruneElem() function and the editor is happy. The following is the SVG element I used for testing.
< svg width="300" height="200">
  < polygon points="100,10 40,180 190,60 10,60 160,180"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
< /svg>
from http://www.w3schools.com/html/html5_svg.asp

Please consider the pull request. Thanks.
Merge pull request #1154 from cecilialam/patch-4

working with SVG element