This is really kinda two questions.

I have a situation where I have to query and xml document and get a set of nodes, and then re-query that set of nodes again with different criteria to get my final set of nodes to work with.

I think this can be done in XQuery, but I don't know what syntax to use.

I don't know if it can be done in XPath.

So what I'd like to know is...

1. Can you do this in XPath, and if so what is the syntax?

2. If this cannot be done using XPath, then how would I do it in XQuery.