An orthodontist can detect cavities during an examination, but treatment of cavities is generally the role of a dentist.