martin wrote: > then I recommend to add a method to class Node >=20 > def as_xml(self, id): > if self.ack: > ack =3D ' ack=3D"%s"' % self.ack > else: > ack =3D '' > return '<node id=3D"%d"%s>%s</node>' % (id, ack, self.text) ...and pray that nobody will ever pass in a string containing reserved xml characters, or non-ascii data, or a unicode string... </F>