Replace switch with if else
XmlSerializer uses private static methods now