private void saveResults() 
			throws ClusterException {
		
		ObjectFactory obf= new ObjectFactory();
		ClusterDataType cdt= obf.createClusterDataType();
		
		//set the creation date
		try {
			cdt.setXMLFileCreation(DateConverter.CurrentDateToXMLGregorianCalendar());
		} catch (DateConverterException e) {
			throw new ClusterException(e.getMessage(), e);
		}
		
		ClusterListType clusters= obf.createClusterListType();
		clusters.setK(BigInteger.valueOf(this.clusterNumber));
		clusters.setIter(BigInteger.valueOf(this.iter));
		Iterator<Cluster> iterC= this.clusterList.iterator();
		
		while(iterC.hasNext()) {
			Cluster c= iterC.next();
			ClusterType ct= obf.createClusterType();
			ct.setId(BigInteger.valueOf(c.getId()));
			ct.setCount(BigInteger.valueOf(c.getSongCount()));
			Iterator<Song> iterS= c.getSongListCopy().iterator();
			
			while(iterS.hasNext()) {
				Song s= iterS.next();
				ct.getSongPath().add(s.getPath());
			}
			
			clusters.getCluster().add(ct);
		}
		
		cdt.setClusterList(clusters);
		
		File output= null;
		
		try {
			//marshall this JaxbElement
			JAXBContext jc= JAXBContext.newInstance("clusterArtifacts");
			JAXBElement<ClusterDataType> je= obf.createClusterData(cdt);
			Marshaller m= jc.createMarshaller();
			m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
			SchemaFactory sf= SchemaFactory.newInstance(W3C_XML_SCHEMA_NS_URI);
			InputStream is= LowLevelSongFeature.class.getClassLoader().getResourceAsStream("MetadataSchema/cluster.xsd");
			Schema schema= sf.newSchema(new StreamSource(is));
			m.setSchema(schema);
			m.setEventHandler(new ValidationEventHandler() {
				
				@Override
				public boolean handleEvent(ValidationEvent event) {
					return false;
				}
			});
			
			output= new File("KMEANS "+new Date().toString()+".xml");
			m.marshal(je, output);
	
		} catch (JAXBException e) {
			if(output != null) {
				this.log.warning("Error "+output.getName()+" "+e.getMessage());
				output.delete();
			} else {
				this.log.warning("Error to create kmeans file result. "+e.getMessage());
			}
			throw new ClusterException("JAXBException "+e.getMessage(), e);
		} catch (SAXException e) {
			this.log.warning("Error in kemans. "+e.getMessage());
			throw new ClusterException("SAXException "+e.getMessage(), e);
		} catch (Exception e) {
			this.log.warning("Error in kemans. "+e.getMessage());
			throw new ClusterException("Exception "+e.getMessage(), e);
		}
		
	}