added toXml method