You have to buy Windows 10, as there is no free upgrade to 10 from XP.
Microsoft on Monday told CNET that Windows 10 will cost just as much as its predecessor. That means prices for Windows 10 will run anywhere from $110 for the Windows 10 Home package to $199 for the Windows 10 Pro edition. Additionally a Windows 10 Pro Pack will let users upgrade from Home to Pro for $99.
How to buy Windows 10:
But first make sure that you have the correct system requirements and that your Computer Manufacturer supplies the correct Drivers for 10.
“Windows 10 System Requirements”
Microsoft is making Windows 10 available as free upgrade for qualified Windows 7, Windows 8.1, and Windows Phone 8.1 devices. It will be available starting July 29, 2015
“Windows 10 FAQs”