added WriteXML