added function toXML