Elon Musk's AI startup, xAI, has acquired his social media platform X, formerly known as Twitter, in an all-stock deal.