code: function(el) {
  	// manually create a copy of the element
  	var new_el = document.createElementNS(el.namespaceURI, el.nodeName);
  	$.each(el.attributes, function(i, attr) {
  		if (attr.localName != '-moz-math-font-style') {
  			new_el.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.nodeValue);
  		}
  	});
  	// set the copied element's new id
  	new_el.removeAttribute("id");
  	new_el.id = getNextId();
  	
  	// Opera's "d" value needs to be reset for Opera/Win/non-EN
  	// Also needed for webkit (else does not keep curved segments on clone)
  	if (svgedit.browser.isWebkit() && el.nodeName == 'path') {
  		var fixed_d = pathActions.convertPath(el);
  		new_el.setAttribute('d', fixed_d);
  	}
  
  	// now create copies of all children
  	$.each(el.childNodes, function(i, child) {
  		switch(child.nodeType) {
  			case 1: // element node
  				new_el.appendChild(copyElem(child));
  				break;
  			case 3: // text node
  				new_el.textContent = child.nodeValue;
  				break;
  			default:
  				break;
  		}
  	});
  	
  	if ($(el).data('gsvg')) {
  		$(new_el).data('gsvg', new_el.firstChild);
  	} else if ($(el).data('symbol')) {
  		var ref = $(el).data('symbol');
  		$(new_el).data('ref', ref).data('symbol', ref);
  	} else if (new_el.tagName == 'image') {
  		preventClickDefault(new_el);
  	}
  	return new_el;
  }
docs: Function: copyElem Create a clone of an element, updating its ID and its children's IDs when needed  Parameters: el - DOM element to clone  Returns: The cloned element