One common edgy practice is to put leading and/or trailing whitespace into metadata elements whose contents are defined as something like an anyURI. You can't strictly speaking rely on a consumer handling this as you expect, but in many cases it works anyway either because the consumer is schema-aware or performs either explicit or implicit trimming of its own.
If you don't want to have the discussion about what is strictly correct, it would be valuable to have a stage which fixed things up on the fly by trimming leading and trailing whitespace from named elements.
I think a Collection<QName> makes most sense as the selector. You could go for a single QName but I think you're more likely to have a number of elements to handle this on. Another alternative would be a String namespace and a Collection<String> for the elements in that namespace.
I'm going to need one of these in the ukf-mda project fairly soon, so this is probably going to end up as a placeholder for pulling that back into the core code.