First you must decide, do I want to go wired or wireless.
Wired is a faster connection; Wireless is more convenient.
If you already have network cards built into the machine (RJ45 connections) the cheapest way is to buy a CROSSOVER cable and connect the two machines together. XP will do the rest for you! If you choose this method, the machine that is directly connected to the Internet MUST be on, for both machines to access the Internet together.
Alternatively, you could buy a Router or Modem/Router. A Modem/Router is necessary if you don't already have an external modem. These can be either wired or wireless. With this method, the router becomes your gateway to the Internet and each machine can connect individually (without the other being on).
As already mentioned, a lot will depend on whether you already have built in network cards, which you may, due to cost considerations, wish to utilise.
click here for an overview and good read on networking in general. All it will cost you, is a little of your time!