How would you summarize the function of Peyer patches

How would you summarize the function of Peyer patches (lymph nodules associated with the distal portion of the small intestine)and lymph nodules in the appendix (which is associated with the cecum, the first part of the large intestine)?