Added toXML method