So am I right on organizing them? If a Hammer has ingredients of wood and iron then I would have three separate XML files.
One for wood, one for iron and one with craftable items (hammer, basket, hat)?
If user searches hammer then it will show wood and iron.
If user searches wood then hammer will show up.
If user searches wood and iron then I can compare and still bring up hammer since it is in both?
If I search leaf and wood then hammer would not show up because hammer isn't under leaf.
I assume I would compare the the leaf and wood XML and remove the ones that don't match.
I am not sure how to do that. Would I somehow use an array to compare?
Would this be the best way?
Yea, that looks good. The alternative is to do a backwards search through parameters, which would take considerable cpu power.