Sets the doc for the xpath transformation. Resets the cache if needed
if (localDoc.get()!=doc) {
CachedXPathAPI cx=(CachedXPathAPI)local.get();
if (cx==null) {
cx=new CachedXPathAPI();
local.set(cx);
localDoc.set(doc);
return;
}
//Different docs reset.
cx.getXPathContext().reset();
localDoc.set(doc);
}