//J+
CachedXPathAPI xpathAPI = new CachedXPathAPI();
XMLUtils.circumventBug2650(doc);
NodeList nodes = xpathAPI.selectNodeList(doc, xpath, nscontext);
Canonicalizer c14n =
Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
byte c14nBytes[] = c14n.canonicalizeXPathNodeSet(nodes);
InputStream refStream = resolver.resolveEntity(null,
fileRef).getByteStream();