Fixed location provider to work well with both named and unnamed
elements.
More aggressive caching for xrefs calculation