anchor.diff:  default_state(DB, Uri, Stamp) ->
      {_UriId, M1} = get_name_id(DB, <<>>, #{}),
      {_XmlId, M2} = get_name_id(DB, <<"http://www.w3.org/XML/1998/namespace">>, M1),
  -   #{doc_id   => {Uri,Stamp}, % unique document ID
  +   DocId = {Uri,Stamp},
  +	% pre-encode the doc id
  +   DocIdEnc = patch_encode({DocId}),
  +   #{doc_id   => {DocId, DocIdEnc}, % unique document ID
        writer   => [],       % index writer/collector process 
        pos      => 0,        % current position    -> simply counts forward
        parent   => <<>>,     % node stack  -> each node Pos is appended, makes up the unique NodeId
  
positive.code:    ok.
  
  
  post_node_indexes(Writer, DocId, NodeId, NodeBin, PathId, Counter) ->
     Props = term_to_binary({NodeBin, PathId}),
     Counter2 = update_counter(Counter, PathId, 1),
     Postings = 
       [{path, {DocId, PathId}, NodeId},
        {node, sext:encode({DocId, NodeId}), Props}
        ],
     Writer ! {postings, self(), Postings},
     _ = receive continue -> ok end,
     Counter2.
  
  post_namespace_node(Writer, DocId, NodeId, UriId, Prefix) ->
     Postings = 
       [{namespace, {DocId, NodeId}, {UriId, Prefix}}],
     Writer ! {postings, self(), Postings},
  
negative.code:        timeout
     end.
  
  -define(MAX_POST, 5000).
  
  
  wait_index_writer(Pid) ->
  