China's investments in Morocco's infrastructure and railway have grown in recent years. Xi made the "brief visit" in the African country after wrapping up the G20 summit in Brazil.