private void createXml(List<WordWithCount> sortedList) throws IOException {
		//refactoring mMaxCount to the value of the word at the 10% place (10% most freq)
		int wordsCount = Math.min(mMaxWords, sortedList.size());
		mMaxCount = sortedList.get((int)(0.05f * wordsCount)).getFreq();
		mOutput.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
		mOutput.write("<wordlist>\n");
		int wordIndex = 0;
		for(WordWithCount word : sortedList)
		{
			if (wordIndex > mMaxWords)
				break;
			
			mOutput.write("<w f=\""+calcActualFreq(word.getFreq())+"\">"+word.getWord()+"</w>\n");
			wordIndex++;
		}
		mOutput.write("</wordlist>\n");
	}