SVGGeneratorContext svgcxt = SVGGeneratorContext.createDefault(svgdoc);
SVGGeneratorContext svgcxt = SVGGeneratorContext.createDefault(clone);
    private void insertImage(UserDataVO userdata) throws FileNotFoundException, IOException{    	log.debug(">insertImage("+userdata != null ? userdata.getUsername() : "null"+")");    	int imgx = 0;    	int imgy = 0;    	int imgwidth = 0;    	int imgheight = 0;    	    	String transform = null;    	// Get image info from template    	NodeList list = svgdoc.getDocumentElement().getElementsByTagName("rect");    	int numberofelements = list.getLength();    	for(int i=0; i<numberofelements; i++){    		Node node = list.item(i);		      		if(node instanceof SVGRectElement){    			SVGRectElement rectnode = (SVGRectElement) node;    			if(rectnode.getId().equalsIgnoreCase("USERPICTURE")){    				transform = rectnode.getAttribute("transform");    				imgx = (int) rectnode.getX().getBaseVal().getValue();    				imgy = (int) rectnode.getY().getBaseVal().getValue();                        				imgwidth = (int) rectnode.getWidth().getBaseVal().getValue();    				imgheight = (int) rectnode.getHeight().getBaseVal().getValue();    				    			}    		}    	}      	    	if(imgwidth != 0 && imgheight != 0){    	    		// Special dravel for demo remove    		// BufferedImage image = ImageIO.read(new FileInputStream("c:\\userpicture.jpg"));    		// TODO: get image.    		BufferedImage image = null;    		    		SVGOMImageElement imageelement = new SVGOMImageElement("", svgdoc);     		SimpleImageHandler imagehandler = new SimpleImageHandler(new ImageHandlerBase64Encoder());    		    		SVGGeneratorContext svgcxt = SVGGeneratorContext.createDefault(svgdoc);    		    		imagehandler.handleImage((RenderedImage) image, imageelement,      				imgx, imgy, 					imgwidth, imgheight, 					svgcxt);    		    		if(transform != null && !transform.equals(""))    			imageelement.setAttribute("transform", transform);     		    		svgdoc.getRootElement().appendChild(imageelement);    	}    	    }