}
if (!Type.subTypeOf(nodes.itemAt(0).getType(), Type.NODE)) {
logger.error(ErrorCodes.XPTY0004 + " fn:id() argument is not a node");
throw new XPathException(this, ErrorCodes.XPTY0004, "XPTY0004: fn:id() argument is not a node", nodes);
}
NodeValue node = (NodeValue)nodes.itemAt(0);
if (node.getImplementationType() == NodeValue.IN_MEMORY_NODE)
//TODO : how to enforce this ?
//If $node, or the context item if the second argument is omitted,
//is a node in a tree whose root is not a document node [err:FODC0001] is raised processInMem = true;
{processInMem = true;}