public static void UpdateGeneratorName(String profile, 
			                               String oldgenername, String newgenername)
	{
		File file = new File(profile);
		if (file.exists())
		{
			try
			{
				// Create a factory
		        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
		        // Use the factory to create a builder
		        DocumentBuilder builder = factory.newDocumentBuilder();
		        Document doc = builder.parse(file);
		        doc.normalize();
		        	        
		        NodeList nodelist = doc.getElementsByTagName(GENERATOR);
		        if (nodelist.getLength() != 0)
		        {
		        	Element elem;
		        	for (int i = 0; i < nodelist.getLength(); i++)
		        	{
		        		elem = (Element)nodelist.item(i);
		        		//find the generator
		        		if (elem.getAttribute("name").equals(oldgenername))
		        		{
		        			elem.setAttribute("name", newgenername);
		        			doc2XmlFile(doc, profile);
		        			break;
		        		}
		        	}
		        }
		        
			}
			catch (Exception e)
			{
				System.out.println(e.toString());
				e.getStackTrace();
			}
		}
		 
	}