Design

A new mapping will be created XMLVariableXPathMapping and it will extend the AnyCollectionMapping

This mapping will assume that the key names are unique so will never write ['s in JSON

This annotation only makes sense when the referenced type is a complex thing. An exception will be thrown if this annotation is used on a simple object or List of simple things.

Limitations

Since this makes use of the any logic during unmarshal and MOXy only handles one Any mapping on a classif a class makes use of the XmlVariableNode annotation then that class can not have XmlAnyElement annotations or any other variables that would cause AnyObject or AnyCollection mappings to be created.

Note/Issues

inheritance

List<Object>

single case ie:not on a collection XMLVariableXPathObjectMapping XMLVariableXPathCollectionMapping

external bindings

don`t write out that property itself as nested if it is the variable field - currently need to mark that property as transient.