Canonicalizer canonicalizer = Canonicalizer.getInstance(algorithmURI);
XmlNode startingNode = getStartingNode(block);
byte[] result;
CanonicalFilter filter = new CanonicalFilter(context, block);
if (inclusive_namespace == null) {
result = canonicalizer.canonicalizeSubtree(startingNode.getNode(), filter);
} else {
result = canonicalizer.canonicalizeSubtree(startingNode.getNode(), inclusive_namespace, filter);
}
String resultString = new String(result, "UTF-8");
return stringOrNil(context.getRuntime(), resultString);