throws RepositoryException {
ImmutableTree parentTree = new ImmutableTree(parent.getNodeState());
NodeState childState;
if (NT_FROZENNODE.equals(child.getName(JCR_PRIMARYTYPE))) {
// need to translate into a regular node to get proper OPV value
NodeBuilder builder = new MemoryNodeBuilder(EmptyNodeState.EMPTY_NODE);
builder.setProperty(JCR_PRIMARYTYPE, child.getName(JCR_FROZENPRIMARYTYPE), Type.NAME);
builder.setProperty(JCR_MIXINTYPES, child.getNames(JCR_MIXINTYPES), Type.NAMES);
childState = builder.getNodeState();
} else {
childState = child.getNodeState();
}
ImmutableTree childTree = new ImmutableTree(
parentTree, childName, childState);