code: def node2freqt(docgraph, node_id, child_str='', include_pos=False,
                 escape_func=FREQT_ESCAPE_FUNC):
      
      node_attrs = docgraph.node[node_id]
      if istoken(docgraph, node_id):
          token_str = escape_func(node_attrs[docgraph.ns+':token'])
          if include_pos:
              pos_str = escape_func(node_attrs.get(docgraph.ns+':pos', ''))
              return u"({pos}({token}){child})".format(
                  pos=pos_str, token=token_str, child=child_str)
          else:
              return u"({token}{child})".format(token=token_str, child=child_str)
  
      else:  # node is not a token
          label_str=escape_func(node_attrs.get('label', node_id))
          return u"({label}{child})".format(label=label_str, child=child_str)
docs: convert a docgraph node into a FREQT string.