// Path: src/rene/util/list/Tree.java
// public class Tree
// {	ListClass Children; // list of children, each with Tree as content
// 	Object Content; // content
// 	ListElement Le; // the listelement containing the tree
// 	Tree Parent; // the parent tree
// 
// 	/** initialize with an object and no children */
// 	public Tree (Object o)
// 	{	Content=o;
// 		Children=new ListClass();
// 		Le=null; Parent=null;
// 	}
// 
// 	/** add a child tree */
// 	public void addchild (Tree t)
// 	{	ListElement p=new ListElement(t);
// 		Children.append(p);
// 		t.Le=p; t.Parent=this;
// 	}
// 
// 	/** insert a child tree */
// 	public void insertchild (Tree t)
// 	{	if (!haschildren()) // simple case
// 		{	addchild(t); return;
// 		}
// 		// give t my children
// 		t.Children=Children;
// 		// make t my only child
// 		Children=new ListClass();
// 		ListElement p=new ListElement(t);
// 		Children.append(p);
// 		t.Le=p; t.Parent=this;
// 		// fix the parents of all grandchildren
// 		ListElement le=t.Children.first();
// 		while (le!=null)
// 		{	Tree h=(Tree)(le.content());
// 			h.Parent=t;
// 			le=le.next();
// 		}
// 	}
// 
// 	/** remove the specific child tree (must be in the tree!!!) */
// 	public void remove (Tree t)
// 	{	if (t.parent()!=this) return;
// 		Children.remove(t.Le);
// 	}
// 
// 	/** remove all children */
// 	public void removeall ()
// 	{	Children.removeall();
// 	}
// 
// 	// Access Methods:
// 	public boolean haschildren () { return Children.first()!=null; }
// 	public Tree firstchild () { return (Tree)Children.first().content(); }
// 	public Tree lastchild () { return (Tree)Children.last().content(); }
// 	public Tree parent () { return Parent; }
// 	public ListClass children () { return Children; }
// 	public Object content () { return Content; }
// 	public void content (Object o) { Content=o; }
// 	public ListElement listelement () { return Le; }
// }


import java.io.PrintWriter;
import rene.util.list.ListClass;
import rene.util.list.ListElement;
import rene.util.list.Tree;
import rene.util.xml.XmlWriter;

		while (p!=null)
		{	a=(Action)p.content();
			a.print(xml,size,number);
			if (a.type().equals("B") || a.type().equals("W")) number++;
			p=p.next();
		}
		xml.endTagNewLine("Node");
	}

	/** remove all actions */
	public void removeactions ()
	{	Actions=new ListClass();
	}

	/** add a new change to this node */
	public void addchange (Change c)
	{	Changes.append(new ListElement(c));
	}

	/** clear the list of changes */
	public void clearchanges ()
	{	Changes.removeall();
	}	

	// modification methods:
	public void main (boolean m) { Main=m; }
	/** 
	Set the Main flag
	@param Tree is the tree, which contains this node on root.
	*/

// Path: src/rene/util/list/Tree.java
// public class Tree
// {	ListClass Children; // list of children, each with Tree as content
// 	Object Content; // content
// 	ListElement Le; // the listelement containing the tree
// 	Tree Parent; // the parent tree
// 
// 	/** initialize with an object and no children */
// 	public Tree (Object o)
// 	{	Content=o;
// 		Children=new ListClass();
// 		Le=null; Parent=null;
// 	}
// 
// 	/** add a child tree */
// 	public void addchild (Tree t)
// 	{	ListElement p=new ListElement(t);
// 		Children.append(p);
// 		t.Le=p; t.Parent=this;
// 	}
// 
// 	/** insert a child tree */
// 	public void insertchild (Tree t)
// 	{	if (!haschildren()) // simple case
// 		{	addchild(t); return;
// 		}
// 		// give t my children
// 		t.Children=Children;
// 		// make t my only child
// 		Children=new ListClass();
// 		ListElement p=new ListElement(t);
// 		Children.append(p);
// 		t.Le=p; t.Parent=this;
// 		// fix the parents of all grandchildren
// 		ListElement le=t.Children.first();
// 		while (le!=null)
// 		{	Tree h=(Tree)(le.content());
// 			h.Parent=t;
// 			le=le.next();
// 		}
// 	}
// 
// 	/** remove the specific child tree (must be in the tree!!!) */
// 	public void remove (Tree t)
// 	{	if (t.parent()!=this) return;
// 		Children.remove(t.Le);
// 	}
// 
// 	/** remove all children */
// 	public void removeall ()
// 	{	Children.removeall();
// 	}
// 
// 	// Access Methods:
// 	public boolean haschildren () { return Children.first()!=null; }
// 	public Tree firstchild () { return (Tree)Children.first().content(); }
// 	public Tree lastchild () { return (Tree)Children.last().content(); }
// 	public Tree parent () { return Parent; }
// 	public ListClass children () { return Children; }
// 	public Object content () { return Content; }
// 	public void content (Object o) { Content=o; }
// 	public ListElement listelement () { return Le; }
// }


// Path: src/fr/xtof54/sgfsearch/Node.java
import java.io.PrintWriter;
import rene.util.list.ListClass;
import rene.util.list.ListElement;
import rene.util.list.Tree;
import rene.util.xml.XmlWriter;

		while (p!=null)
		{	a=(Action)p.content();
			a.print(xml,size,number);
			if (a.type().equals("B") || a.type().equals("W")) number++;
			p=p.next();
		}
		xml.endTagNewLine("Node");
	}

	/** remove all actions */
	public void removeactions ()
	{	Actions=new ListClass();
	}

	/** add a new change to this node */
	public void addchange (Change c)
	{	Changes.append(new ListElement(c));
	}

	/** clear the list of changes */
	public void clearchanges ()
	{	Changes.removeall();
	}	

	// modification methods:
	public void main (boolean m) { Main=m; }
	/** 
	Set the Main flag
	@param Tree is the tree, which contains this node on root.
	*/

	public void main (Tree p)
