     holder = []
     holder.unshift top
 
-    helper.depthFirstIterativePreorder body, _depthWalkCallbackGenerator(holder)
+    helper.depthFirstIterativePreorder body, _depthWalkCallbackGenerator(holder, _makeNodeTitle)
 
     $(selector).jstree(
       json_data:
-        data: [top]
+        data: [top['children']]
       ui: 
         select_limit: 1
       core:

        editor.focus()
        previousNode = id

  _depthWalkCallbackGenerator = (holder) ->
    depthWalkCallback = (depth) ->
      node = this
      if not node.getAttribute?

        delete items["around"]
      items

  # TODO: This should be passed in as part of the tree initialization
  _makeNodeTitle = (node, title) ->
    switch title
      when "ref" then $(node).children('[data-xmlel="label"]').text() || false
      when "article"
        $(node).children('[data-xmlel="front"]')
          .find('[data-xmlel="article-title"]')
          .map((idx, ele) -> $(ele).text()).get().join(", ")
      when "title", "article-id" then $(node).text()
      when "journal-id", "issn", "publisher" then $(node).text()
      when "sec", "ack", "ref-list" then $(node).children('[data-xmlel="title"]').text()
      when "p" then $(node).text().substr(0, 20) + "..."

      
  updateTree = (selector, editor) ->
    body = editor.dom.getRoot()

