Bug 4139 EC DCR: Code templates feature (1GIVMDV)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateSet.java
sort();
		
		return false;
	}
	/**
	 * Saves the template set.
	 */
	public boolean save() {					
		try {
			fgTemplateSet.save(new FileOutputStream(getTemplateFile()));
			return true;
		} catch (IOException e) {
			JavaPlugin.log(e);
			return false;
		}
	}
	/**
	 * Saves the template set as XML.
	 */
	private boolean save(OutputStream stream) {
		try {
			DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();
			DocumentBuilder builder= factory.newDocumentBuilder();		
			Document document= builder.newDocument();
			Node root= document.createElement("templates"); 
			document.appendChild(root);
			
			for (int i= 0; i != fTemplates.size(); i++) {
				Template template= (Template) fTemplates.get(i);