She needs to present her passport. It must be valid at least three months after she intends to leave, and it must have been issued within the previous 10 years before she arrives (Schengen Borders Code Article 6(1)(a)).
Border guards could ask her to show evidence justifying her purpose of travel and means of support (see Art. 6(1)(c)), but it isn't generally a good idea to offer these things without being asked.
Examples of the kinds of documents they could ask her for are in Annex I of the code; one example is
(c) for journeys undertaken for the purposes of tourism or for private reasons:
(i) supporting documents as regards lodging:
— an invitation from the host if staying with one;
...
Rather than carrying a formal letter from you, she could probably just print an e-mail message in which you discuss your plans; the chance that she'll actually need this is pretty small. You should be on hand to receive a phone call while she is in Madrid in case they want to corroborate her story. But most likely they'll just scan and stamp her passport and send her on to her next flight.
Germany does have a document called a Verpflichtungserklärung, in which a sponsor undertakes formal responsibility for a visitor's financial support, but this seems to be required only for visa applicants, and even then only for some visa applicants, so it does not apply.