Working Write() and ReadXML() methods