Book moderately priced tickets from Madrid to Milan on the RENFE Web site (see Resources below).
Choose the Altaria (ATR) route for the first leg of your journey. This will take you from Madrid to Barcelona.
Book the second half of your trip on the Talgo Elipsos (TLG), which will take you from Barcelona to Milan.
Purchase your train tickets using the TIKNET feature. To do so, you are required to register as a customer.
Print out the confirmation page and bring it with you on your trip.