public void saveStreamVector() {
		String savePath =  new Control_GetPath().getStreamRipStarPath();
		XMLOutputFactory outputFactory = XMLOutputFactory.newInstance(); 
		try {
			XMLEventWriter writer = outputFactory.createXMLEventWriter( new FileOutputStream(savePath+"/Streams.xml" ), "UTF-8");
			XMLEventFactory eventFactory = XMLEventFactory.newInstance();
			
			//header for the file
			XMLEvent header = eventFactory.createStartDocument();
			XMLEvent startRootAllStreams = eventFactory.createStartElement( "", "", "allStreams" ); 
			XMLEvent lastStreamID = eventFactory.createAttribute( "lastStreamID", String.valueOf( Stream.lastID )); 
			writer.add( header ); 
			writer.add( startRootAllStreams );
			writer.add( lastStreamID );
			
			for(int i=0;i < streamVector.capacity();i++) {
				//start creating a stream
				XMLEvent startStream = eventFactory.createStartElement( "", "", "Stream" );
				
				XMLEvent id = eventFactory.createAttribute( "id", String.valueOf(streamVector.get(i).id) ); 
				XMLEvent name = eventFactory.createAttribute( "name", streamVector.get(i).name  ); 
				XMLEvent completeCB = eventFactory.createAttribute( "completeCB", String.valueOf(streamVector.get(i).completeCB));
				XMLEvent address = eventFactory.createAttribute( "address", streamVector.get(i).address  );
				XMLEvent website = eventFactory.createAttribute( "website", streamVector.get(i).website  );
				XMLEvent genre = eventFactory.createAttribute( "genre", streamVector.get(i).genre  );
				XMLEvent comment = eventFactory.createAttribute( "comment", streamVector.get(i).comment  );
				XMLEvent singleFileTF = eventFactory.createAttribute( "singleFileTF", streamVector.get(i).singleFileTF  );
				XMLEvent maxTimeHHTF = eventFactory.createAttribute( "maxTimeHHTF", streamVector.get(i).maxTimeHHTF  );
				XMLEvent maxTimeMMTF = eventFactory.createAttribute( "maxTimeMMTF", streamVector.get(i).maxTimeMMTF  );
				XMLEvent maxTimessTF = eventFactory.createAttribute( "maxTimessTF", streamVector.get(i).maxTimessTF  );
				XMLEvent maxMBTF = eventFactory.createAttribute( "maxMBTF", streamVector.get(i).maxMBTF  );
				XMLEvent sequenzTF = eventFactory.createAttribute( "sequenzTF", streamVector.get(i).sequenzTF  );
				XMLEvent patternTF = eventFactory.createAttribute( "patternTF", streamVector.get(i).patternTF  );
				XMLEvent relayServerPortTF = eventFactory.createAttribute( "relayServerPortTF", streamVector.get(i).relayServerPortTF  );
				XMLEvent maxConnectRelayTF = eventFactory.createAttribute( "maxConnectRelayTF", streamVector.get(i).maxConnectRelayTF  );
				XMLEvent relayPlayListTF = eventFactory.createAttribute( "relayPlayListTF", streamVector.get(i).relayPlayListTF  );
				XMLEvent timeOutReonTF = eventFactory.createAttribute( "timeOutReonTF", streamVector.get(i).timeOutReonTF  );
				XMLEvent proxyTF = eventFactory.createAttribute( "proxyTF", streamVector.get(i).proxyTF  );
				XMLEvent useragentTF = eventFactory.createAttribute( "useragentTF", streamVector.get(i).useragentTF  );
				XMLEvent sciptSongsTF = eventFactory.createAttribute( "sciptSongsTF", streamVector.get(i).sciptSongsTF  );
				XMLEvent metaDataFileTF = eventFactory.createAttribute( "metaDataFileTF", streamVector.get(i).metaDataFileTF  );
				XMLEvent interfaceTF = eventFactory.createAttribute( "interfaceTF", streamVector.get(i).interfaceTF  );
				XMLEvent externTF = eventFactory.createAttribute( "externTF", streamVector.get(i).externTF  );
				XMLEvent extraArgsTF = eventFactory.createAttribute( "extraArgsTF", streamVector.get(i).extraArgsTF  );
				XMLEvent CSRelayTF = eventFactory.createAttribute( "CSRelayTF", streamVector.get(i).CSRelayTF );
				XMLEvent CSMetaDataTF = eventFactory.createAttribute( "CSMetaDataTF", streamVector.get(i).CSMetaDataTF  );
				XMLEvent CSIDTF = eventFactory.createAttribute( "CSIDTF", streamVector.get(i).CSIDTF  );
				XMLEvent CSFileSysTF = eventFactory.createAttribute( "CSFileSysTF", streamVector.get(i).CSFileSysTF  );
				XMLEvent SPDelayTF = eventFactory.createAttribute( "SPDelayTF", streamVector.get(i).SPDelayTF  );
				XMLEvent SPExtraTF1 = eventFactory.createAttribute( "SPExtraTF1", streamVector.get(i).SPExtraTF1  );
				XMLEvent SPExtraTF2 = eventFactory.createAttribute( "SPExtraTF2", streamVector.get(i).SPExtraTF2  );
				XMLEvent SPWindowTF1 = eventFactory.createAttribute( "SPWindowTF1", streamVector.get(i).SPWindowTF1  );
				XMLEvent SPWindowTF2 = eventFactory.createAttribute( "SPWindowTF2", streamVector.get(i).SPWindowTF2  );
				XMLEvent SPSilenceTF = eventFactory.createAttribute( "SPSilenceTF", streamVector.get(i).SPSilenceTF  );
				XMLEvent singleFileCB = eventFactory.createAttribute( "singleFileCB", String.valueOf(streamVector.get(i).singleFileCB));
				XMLEvent maxTimeCB = eventFactory.createAttribute( "maxTimeCB", String.valueOf(streamVector.get(i).maxTimeCB));
				XMLEvent maxMBCB = eventFactory.createAttribute( "maxMBCB", String.valueOf(streamVector.get(i).maxMBCB));
				XMLEvent sequenzCB = eventFactory.createAttribute( "sequenzCB", String.valueOf(streamVector.get(i).sequenzCB));
				XMLEvent patternCB = eventFactory.createAttribute( "patternCB", String.valueOf(streamVector.get(i).patternCB));
				XMLEvent cutSongIncompleteCB = eventFactory.createAttribute( "cutSongIncompleteCB", String.valueOf(streamVector.get(i).cutSongIncompleteCB));
				XMLEvent neverOverIncompCB = eventFactory.createAttribute( "neverOverIncompCB", String.valueOf(streamVector.get(i).neverOverIncompCB));
				XMLEvent noDirEveryStreamCB = eventFactory.createAttribute( "noDirEveryStreamCB", String.valueOf(streamVector.get(i).noDirEveryStreamCB));
				XMLEvent noIndiviSongsCB = eventFactory.createAttribute( "noIndiviSongsCB", String.valueOf(streamVector.get(i).noIndiviSongsCB));
				XMLEvent createReayCB = eventFactory.createAttribute( "createReayCB", String.valueOf(streamVector.get(i).createReayCB));
				XMLEvent connectToRelayCB = eventFactory.createAttribute( "connectToRelayCB", String.valueOf(streamVector.get(i).connectToRelayCB));
				XMLEvent createPlaylistRelayCB = eventFactory.createAttribute( "createPlaylistRelayCB", String.valueOf(streamVector.get(i).createPlaylistRelayCB));
				XMLEvent dontSearchAltPortCB = eventFactory.createAttribute( "dontSearchAltPortCB", String.valueOf(streamVector.get(i).dontSearchAltPortCB));
				XMLEvent dontAutoReconnectCB = eventFactory.createAttribute( "dontAutoReconnectCB", String.valueOf(streamVector.get(i).dontAutoReconnectCB));
				XMLEvent timeoutReconnectCB = eventFactory.createAttribute( "timeoutReconnectCB", String.valueOf(streamVector.get(i).timeoutReconnectCB));
				XMLEvent proxyCB = eventFactory.createAttribute( "proxyCB", String.valueOf(streamVector.get(i).proxyCB));
				XMLEvent useragentCB = eventFactory.createAttribute( "useragentCB", String.valueOf(streamVector.get(i).useragentCB));
				XMLEvent countBeforStartCB = eventFactory.createAttribute( "countBeforStartCB", String.valueOf(streamVector.get(i).countBeforStartCB));
				XMLEvent metaDataCB = eventFactory.createAttribute( "metaDataCB", String.valueOf(streamVector.get(i).metaDataCB));
				XMLEvent interfaceCB = eventFactory.createAttribute( "interfaceCB", String.valueOf(streamVector.get(i).interfaceCB));
				XMLEvent externMetaDataCB = eventFactory.createAttribute( "externMetaDataCB", String.valueOf(streamVector.get(i).externMetaDataCB));
				XMLEvent extraArgsCB = eventFactory.createAttribute( "extraArgsCB", String.valueOf(streamVector.get(i).extraArgsCB));
				XMLEvent CSRelayCB = eventFactory.createAttribute( "CSRelayCB", String.valueOf(streamVector.get(i).CSRelayCB));
				XMLEvent CSMetaCB = eventFactory.createAttribute( "CSMetaCB", String.valueOf(streamVector.get(i).CSMetaCB));
				XMLEvent CSIDTagCB = eventFactory.createAttribute( "CSIDTagCB", String.valueOf(streamVector.get(i).CSIDTagCB));
				XMLEvent CSFileSysCB = eventFactory.createAttribute( "CSFileSysCB", String.valueOf(streamVector.get(i).CSFileSysCB));
				XMLEvent XS2CB = eventFactory.createAttribute( "XS2CB", String.valueOf(streamVector.get(i).XS2CB));
				XMLEvent SPDelayCB = eventFactory.createAttribute( "SPDelayCB", String.valueOf(streamVector.get(i).SPDelayCB));
				XMLEvent SPExtraCB = eventFactory.createAttribute( "SPExtraCB", String.valueOf(streamVector.get(i).SPExtraCB));
				XMLEvent SPWindowCB = eventFactory.createAttribute( "SPWindowCB", String.valueOf(streamVector.get(i).SPWindowCB));
				XMLEvent SPSilenceCB = eventFactory.createAttribute( "SPSilenceCB", String.valueOf(streamVector.get(i).SPSilenceCB));
				XMLEvent IDV1CB = eventFactory.createAttribute( "IDV1CB", String.valueOf(streamVector.get(i).IDV1CB));
				XMLEvent IDV2CB = eventFactory.createAttribute( "IDV2CB", String.valueOf(streamVector.get(i).IDV2CB));
				XMLEvent exeCommand = eventFactory.createAttribute( "exeCommand", String.valueOf(streamVector.get(i).getExeCommand()));
				XMLEvent send_name = eventFactory.createAttribute( "send_name", String.valueOf(streamVector.get(i).send_name));
				XMLEvent send_serverName = eventFactory.createAttribute( "send_serverName", String.valueOf(streamVector.get(i).send_serverName));
				XMLEvent send_metainvervall = eventFactory.createAttribute( "send_metainvervall", String.valueOf(streamVector.get(i).send_metainvervall));
				XMLEvent send_bitrate = eventFactory.createAttribute( "send_bitrate", String.valueOf(streamVector.get(i).send_bitrate));
				
				XMLEvent endStream = eventFactory.createEndElement( "", "", "Stream" ); 
				
				//write this stream into file
				writer.add( startStream );
				writer.add( id ); 
				writer.add( name );
				writer.add( completeCB );
				writer.add( address );
				writer.add( website );
				writer.add( genre );
				writer.add( comment );
				writer.add( singleFileTF );
				writer.add( maxTimeHHTF );
				writer.add( maxTimeMMTF );
				writer.add( maxTimessTF);
				writer.add( maxMBTF );
				writer.add( sequenzTF );
				writer.add( patternTF );
				writer.add( relayServerPortTF );
				writer.add( maxConnectRelayTF );
				writer.add( relayPlayListTF );
				writer.add( timeOutReonTF );
				writer.add( proxyTF );
				writer.add( useragentTF );
				writer.add( sciptSongsTF );
				writer.add( metaDataFileTF );
				writer.add( interfaceTF );
				writer.add( externTF );
				writer.add( extraArgsTF );
				writer.add( CSRelayTF );
				writer.add( CSMetaDataTF );
				writer.add( CSIDTF );
				writer.add( CSFileSysTF );
				writer.add( SPDelayTF );
				writer.add( SPExtraTF1 );
				writer.add( SPExtraTF2 );
				writer.add( SPWindowTF1 );
				writer.add( SPWindowTF2 );
				writer.add( SPSilenceTF );
				writer.add( singleFileCB );
				writer.add( maxTimeCB );
				writer.add( maxMBCB );
				writer.add( sequenzCB );
				writer.add( patternCB );
				writer.add( cutSongIncompleteCB );
				writer.add( neverOverIncompCB );
				writer.add( noDirEveryStreamCB );
				writer.add( noIndiviSongsCB );
				writer.add( createReayCB);
				writer.add( connectToRelayCB );
				writer.add( createPlaylistRelayCB);
				writer.add( dontSearchAltPortCB);
				writer.add( dontAutoReconnectCB );
				writer.add( timeoutReconnectCB );
				writer.add( proxyCB);
				writer.add( useragentCB );
				writer.add( countBeforStartCB );
				writer.add( metaDataCB );
				writer.add( interfaceCB );
				writer.add( externMetaDataCB );
				writer.add( extraArgsCB );
				writer.add( CSRelayCB );
				writer.add( CSMetaCB);
				writer.add( CSIDTagCB );
				writer.add( CSFileSysCB );
				writer.add( XS2CB );
				writer.add( SPDelayCB );
				writer.add( SPExtraCB );
				writer.add( SPWindowCB );
				writer.add( SPSilenceCB );
				writer.add( IDV1CB );
				writer.add( IDV2CB );
				writer.add( exeCommand );
				writer.add( send_name );
				writer.add( send_serverName );
				writer.add( send_metainvervall );
				writer.add( send_bitrate );
				
				writer.add( endStream );
			}
			
			XMLEvent endRoot = eventFactory.createEndElement( "", "", "AllStreams" ); 
			XMLEvent endDocument = eventFactory.createEndDocument();
			writer.add( endRoot ); 
			writer.add( endDocument ); 
			writer.close();

		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (XMLStreamException e) {
			e.printStackTrace();
		} 
	}