XmlWriter writer = new XmlWriter (tmpFile);
XmlWriter writer = new XmlWriter (tmpFile, "UTF-8");
		public ESValue callFunction(ESObject thisObject, ESValue[] arguments) throws EcmaScriptException {			if ( arguments==null || arguments.length != 2 )				throw new EcmaScriptException("wrong number of arguments");			INode node = null;			try	{				node = ((ESNode)arguments[0]).getNode();			}	catch ( Exception e )	{				// we definitly need a node				throw new EcmaScriptException("first argument is not an hopobject");			}			try	{				File tmpFile = new File(arguments[1].toString()+".tmp."+XmlWriter.generateID());				XmlWriter writer = new XmlWriter (tmpFile);				writer.setDatabaseMode(false);				boolean result = writer.write(node);				writer.close();				File finalFile = new File(arguments[1].toString());				tmpFile.renameTo (finalFile);				this.evaluator.reval.app.logEvent("wrote xml to " + finalFile.getAbsolutePath() );			}	catch (IOException io)	{				throw new EcmaScriptException (io.toString());			}			return ESBoolean.makeBoolean(true);        }