SAXSerializer serializer = new SAXSerializer(writer, null);
SAXSerializer serializer = SAXSerializerPool.getInstance().borrowSAXSerializer(); serializer.setWriter(writer); serializer.setOutputProperties(null);
	protected void writeQueryHistory() {		try {			BufferedWriter writer=				new BufferedWriter(new FileWriter(queryHistoryFile));			SAXSerializer serializer = new SAXSerializer(writer, null);			int p= 0;			if (queryHistory.size() > 20)				p= queryHistory.size() - 20;			AttributesImpl attrs = new AttributesImpl();			serializer.startDocument();			serializer.startElement("", "history", "history", attrs);			for (ListIterator i= queryHistory.listIterator(p); i.hasNext();) {				serializer.startElement("", "query", "query", attrs);				String next = (String) i.next();				serializer.characters(next.toCharArray(), 0, next.length());				serializer.endElement("", "query", "query");			}			serializer.endElement("", "history", "history");			serializer.endDocument();			writer.close();		} catch (IOException e) {			System.err.println("IO error while writing query history.");		} catch (SAXException e) {			System.err.println("SAX exception while writing query history.");		}	}