And about 'contextValue'.
No, there is no connection yet to the XML tree. Work in progress.

We would need to change the 'std::string' of 'value' inside ContextAttribute to be something similar to what you propose, but simpler:

I think the best way is to simply add a pointer to ComplexValueNode inside ContextAttribute, as a help variable, and to be used as 'value' when 'value' contains the value 'ComplexValue', or simply, when this pointer is non-NULL.
That way we tie the parsed complex value to the contextAttribute.
Some investigation is needed here.