private String prepareConfigFile() {
		StringBuffer buf = new StringBuffer();
		
		buf.append(XMLTools.getXmlDeclaration(null)).append(PlatformCompatibility.LINE_END_DEFAULT);
		buf.append("<").append(E_ROOT);
			buf.append(" ").append(A_SELECTION_MODE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getSelectionMode())).append("\"");
			buf.append(" ").append(A_START_AT_TOP).append("=\"").append(XMLTools.escapeXMLAttribute("" + getStartAtTop())).append("\"");
			buf.append(" ").append(A_WRAP_AROUND).append("=\"").append(XMLTools.escapeXMLAttribute("" + getWrapAround())).append("\"");
			buf.append(" ").append(A_SELECTION_ONLY).append("=\"").append(XMLTools.escapeXMLAttribute("" + getSelectionOnly())).append("\"");
			buf.append(" ").append(A_INCLUDE_READ_ONLY).append("=\"").append(XMLTools.escapeXMLAttribute("" + getIncludeReadOnly())).append("\"");
			buf.append(" ").append(A_INCLUDE_READ_ONLY_ALL_DOCUMENTS).append("=\"").append(XMLTools.escapeXMLAttribute("" + getIncludeReadOnlyAllDocuments())).append("\"");
			buf.append(" ").append(A_PATH).append("=\"").append(XMLTools.escapeXMLAttribute("" + getPath())).append("\"");
			buf.append(" ").append(A_INCLUDE_SUB_DIRS).append("=\"").append(XMLTools.escapeXMLAttribute("" + getIncludeSubDirs())).append("\"");
			buf.append(" ").append(A_MAKE_BACKUPS).append("=\"").append(XMLTools.escapeXMLAttribute("" + getMakeBackups())).append("\"");
			buf.append(" ").append(A_FILE_FILTER_INCLUDE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getFileFilterInclude())).append("\"");
			buf.append(" ").append(A_FILE_FILTER_INCLUDE_IGNORE_CASE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getFileFilterIncludeIgnoreCase())).append("\"");
			buf.append(" ").append(A_FILE_FILTER_EXCLUDE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getFileFilterExclude())).append("\"");
			buf.append(" ").append(A_FILE_FILTER_EXCLUDE_IGNORE_CASE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getFileFilterExcludeIgnoreCase())).append("\"");
			buf.append(" ").append(A_DIR_FILTER_INCLUDE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getDirFilterInclude())).append("\"");
			buf.append(" ").append(A_DIR_FILTER_INCLUDE_IGNORE_CASE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getDirFilterIncludeIgnoreCase())).append("\"");
			buf.append(" ").append(A_DIR_FILTER_EXCLUDE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getDirFilterExclude())).append("\"");
			buf.append(" ").append(A_DIR_FILTER_EXCLUDE_IGNORE_CASE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getDirFilterExcludeIgnoreCase())).append("\"");
		buf.append(">").append(PlatformCompatibility.LINE_END_DEFAULT);
		
		for (int i = 0; i < getSize(); i++) {
			buf.append("<").append(E_ITEM);
			
			buf.append(" ").append(A_NAME).append("=\"").append(XMLTools.escapeXMLAttribute(getName(i))).append("\"");
			buf.append(" ").append(A_FIND).append("=\"").append(XMLTools.escapeXMLAttribute(getFind(i))).append("\"");
			buf.append(" ").append(A_REPLACE).append("=\"").append(XMLTools.escapeXMLAttribute(getReplace(i))).append("\"");
			buf.append(" ").append(A_IGNORE_CASE).append("=\"").append(XMLTools.escapeXMLAttribute("" + getIgnoreCase(i))).append("\"");
			buf.append(" ").append(A_REGEXP).append("=\"").append(XMLTools.escapeXMLAttribute("" + getRegExp(i))).append("\"");
			
			buf.append("/>").append(PlatformCompatibility.LINE_END_DEFAULT);
		}
		
		XMLTools.writeElementEnd(buf, 0, PlatformCompatibility.LINE_END_DEFAULT, E_ROOT);
		return buf.toString();
	}