Proper Way to Address a President in a Formal Letter
President of a country (e.g. The United States) is called 总统 in Chinese

A President or Chairman of a political party (e.g. Communist Party of China ) is called 主席 

To formally address The President of a country in writing, you should use an honorific like 阁下 or 先生 or even 大人 and call him 总统阁下; 总统先生 or even 总统大人 (kind of too old fashion and too humble if you ask me)

Example: 

奥巴马(name) 总统(title) 阁下 (honorific)

习近平(name) 总书记(title) 阁下 (honorific)

Edit:

Sometimes people would call 習近平主席/总书记 as 'President Xi' 

Even Wikipedia refers 習近平 as 'President' 

President of the People's Republic of China