BEIJING - President Xi Jinping will attend a ceremony marking the 25th anniversary of Hong Kong's transfer from British to Chinese rule, official news agency Xinhua said Saturday.