def _node_to_model(tree_or_item, metadata=None, parent=None,<EOL>lucent_id=cnxepub.TRANSLUCENT_BINDER_ID):
if '<STR_LIT>' in tree_or_item:<EOL><INDENT>tree = tree_or_item<EOL>binder = cnxepub.TranslucentBinder(metadata=tree)<EOL>for item in tree['<STR_LIT>']:<EOL><INDENT>node = _node_to_model(item, parent=binder,<EOL>lucent_id=lucent_id)<EOL>if node.metadata['<STR_LIT:title>'] != item['<STR_LIT:title>']:<EOL><INDENT>binder.set_title_for_node(node, item['<STR_LIT:title>'])<EOL><DEDENT><DEDENT>result = binder<EOL><DEDENT>else:<EOL><INDENT>item = tree_or_item<EOL>result = cnxepub.DocumentPointer(item['<STR_LIT:id>'], metadata=item)<EOL><DEDENT>if parent is not None:<EOL><INDENT>parent.append(result)<EOL><DEDENT>return result<EOL>
Given a tree, parse to a set of models