boolean weCatchedTheRelativeNS = false;
try {
Canonicalizer c14n =
Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
c14n.canonicalizeSubtree(doc);
} catch (CanonicalizationException cex) {
// if we reach this point - good.
log.debug("We catched the C14nEx, that's good: " + cex.getMessage());
weCatchedTheRelativeNS = true;