StreamResult result = new StreamResult(writer);
StreamResult result = new StreamResult(stream);
	private static void saveToStream(Map locations, Writer writer) throws CoreException {		try {			DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();			DocumentBuilder builder= factory.newDocumentBuilder();					Document document= builder.newDocument();						Element rootElement = document.createElement(NODE_ROOT);			document.appendChild(rootElement);				Iterator iter= locations.keySet().iterator();						while (iter.hasNext()) {				IPath path= (IPath) iter.next();				URL url= getJavadocBaseLocation(path);							Element varElement= document.createElement(NODE_ENTRY);				varElement.setAttribute(NODE_PATH, path.toString());				varElement.setAttribute(NODE_URL, url.toExternalForm());				rootElement.appendChild(varElement);			}			Transformer transformer=TransformerFactory.newInstance().newTransformer();			transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$			DOMSource source = new DOMSource(document);			StreamResult result = new StreamResult(writer);			transformer.transform(source, result);		} catch (TransformerException e) {			throw createException(e, CorextMessages.getString("JavaDocLocations.error.serializeXML")); //$NON-NLS-1$		} catch (ParserConfigurationException e) {			throw createException(e, CorextMessages.getString("JavaDocLocations.error.serializeXML")); //$NON-NLS-1$		}	}