She [topic-は] book [object-を] writing [purpose-ための] materials [object-を] is-gathering.
ための is the attributive form of ために, modifying the noun 資料. The nested structure — 本を書くための資料 ('materials for book-writing') — shows how Japanese stacks modifiers before their head noun.