Updated XML structure and toXml defintion