docs: function _processNode(node, level) {
          var nodeData = null;
          
          // entity tag
          if (w.isReadOnly === false && node.attr('_entity') && (node.attr('_tag') || node.attr('_note'))) {
              var id = node.attr('name');
              var entity = w.entitiesManager.getEntity(id);
              var type = node.attr('_type');
              var tag = node.attr('_tag');
              if (tag == null) {
                  tag = w.schemaManager.mapper.getParentTag(type);
              }
              
              nodeData = {
                  text: tag,
                  li_attr: {name: id}, // 'class': type}
                  state: {opened: level < 3}
              };
              
              if (w.schemaManager.mapper.isEntityTypeNote(type)) {
                  var content = w.schemaManager.mapper.getNoteContentForEntity(entity);
                  switch($.type(content)) {
                      case 'array':
                          nodeData.children = [];
                          for (var i = 0; i < content.length; i++) {
                              nodeData.children.push({
                                  text: content[i],
                                  li_attr: {name: id}
                              });
                          }
                          break;
                      case 'string':
                          nodeData.children = [];
                          nodeData.children.push({
                              text: content,
                              li_attr: {name: id}
                          });
                          break;
                      case 'object':
                          if (content.nodeType !== undefined) {
                              var root = $(tag, content).first();
                              
                              var processChildren = function(children, parent, id) {
                                  children.each(function(index, el) {
                                      if (parent.children == null) parent.children = [];
                                      var childData = {
                                          text: el.nodeName,
                                          li_attr: {name: id}
                                      };
                                      parent.children.push(childData);
                                      
                                      processChildren($(el).children(), childData, id);
                                  });
                              }
                              
                              processChildren(root.children(), nodeData, id);
                          }
                  }
              }
              
          // structure tag
          } else if (node.attr('_tag')) {
              var tag = node.attr('_tag');
              if (w.isReadOnly === false || (w.isReadOnly && (tag === w.root || tree.tagFilter.indexOf(tag.toLowerCase()) !== -1))) {
                  var id = node.attr('id');
                  var info = w.structs[id];
                  
                  if (info == undefined) {
                      // redo/undo re-added a struct check
                      info = w.deletedStructs[id];
                      if (info != undefined) {
                          w.structs[id] = info;
                          delete w.deletedStructs[id];
                      }
                  }
                  
                  if (info) {
                      var text = info._tag;
                      if (w.isReadOnly) {
                          if (tag === w.root) {
                              text = w.root;// || w.currentDocId;
                          } else {
                              text = w.utilities.getTitleFromContent(node.text());
                          }
                      }
                      nodeData = {
                          text: text,
                          li_attr: {name: id},
                          state: {opened: level < 3}
                      };
                  }
              }
          }
          if (nodeData !== null) {
              nodeData.level = level;
              // FIXME we really shouldn't have this hardcoded here
              // manually set the level for CWRC schema to have proper sorting in readOnly mode
              if (w.schemaManager.schemaId === 'cwrcEntry') {
                  var subtype = node.attr('subtype');
                  if (subtype !== undefined) {
                      nodeData.level = parseInt(subtype);
                  }
              }
          }
          
          return nodeData;
      }