Donald Trump has broken with a long tradition of foreign leaders not attending the presidential swearing-in ceremony.