Sandra,
nice to see your problem has aready been solved.
Queries like this are very very fast: XQUERY //hgf[@n="182400002"] OK 1.12 ms
but queries like this: XQUERY //hgf[@xml:id="hgf182400002"] OK 646.69 ms are positively glacial in comparison,
You got it right; the index is not chosen as a prefix is specified in the predicate test. The complexity of the Namespace specification makes optimizations pretty nasty (although the static xml prefix could be handled rather easy), which is why we skip some compilation steps if a prefix is given. The following query should be evaluated much faster (although it's not exactly the same as yours):
//hgf[@*:id="hgf182400002"]
If you want to get sure that your id attribute belongs to the xml namespace, you can add a second, more specific attribute:
//*[@*:id = 'jff001'][@xml:id = 'jff001']
Hope this helps, Christian