reduce convertRecordToXML's complexity