serialize classes to XML