Thanks for the replies everyone! The sample logic works exactly as I needed! In porting it, everything works when all fields are all in the same group.
How would I need to alter *[local-name(.) = field2] to explicitly define a group to check for a field that matches the value of "field2"? In my case, ...