fix xpath for group_name

- use @owner_id instead of owner_id (in casedb)
- use current()/@owner_id when embedded in another context
- use explicit comparison count(...) != 0, since xpath doesn't do
  falsiness