Is this the struct uses to represent contextValues a the end (versus some "parser-close" structure to be pros-processed at the end to distil the actual contextValue for attributes)? Probably we can use something simpler, such as:

```
typedef struct ComplexValue {
   Type type;
   std::string value;                         // when type = simple value (leaf in your terms, I think)
   std::vector<ComplexValue*> v;              // when type = vector
   std::map<std::string, ComplexValue*> m     // when type = map (struct in your terms).
} ComplexValue;
```
In addition, the ContextAttribute class would change, to use 

```
typedef struct ContextAttribute {
...
   ComplexValue value;
...
} ContextAttribute;
```

Instead of 

```
typedef struct ContextAttribute {
...
   std::string value;
...
} ContextAttribute;
```

I don't see the need of using `root`, `path`, `level`, `sibblingNo`, `counter`, `container` and `rootP`, although I'd be probably missing things (maybe you need it for "parsing dynamics" during the parsing step, before passing them to mongoBackend).