I could be completely wrong, but doesn't the hat produce whatever the person reaching in needs the most at that moment?
ETA: Looked it up. The sword (which was Godric Gryffindor's Sword) "was said to appear whenever a 'true Gryffindor' was in need." And yes, it appeared for Harry from inside the sorting hat in Chamber of Secrets.
__________________
'He who receives an idea from me, receives instruction himself without lessening mine; as he who lights his taper at mine, receives light without darkening me.'
-TJ
|