public void saveXML (PrintWriter o, String encoding)
	// save the file in Jago's XML format
	{
		getinformation();
		T.top().setaction("AP", "Jago:" + GF.version(), true);
		T.top().setaction("SZ", "" + S, true);
		T.top().setaction("GM", "1", true);
		T.top()
			.setaction("FF", GF.getParameter("puresgf", false)?"4":"1", true);
		XmlWriter xml = new XmlWriter(o);
		xml.printEncoding(encoding);
		xml.printXls("go.xsl");
		xml.printDoctype("Go", "go.dtd");
		xml.startTagNewLine("Go");
		for (int i = 0; i < Trees.size(); i++)
		{
			((SGFTree)Trees.elementAt(i)).printXML(xml);
		}
		xml.endTagNewLine("Go");
	}