When serializing objects that have circular dependencies with JAX-B the framework throws a CyclicDependencyDetected exception.
For example there are two classes A and B.
Class A has a property x of type B and class B has a list y of As.
Using the annotations <code>@XmlElementRef B x</code> in class A and <code>@XmlWrapperElement("ys") @XmlElementRef List<A> y</code> in class B will throw the aforementioned exception.
How to serialize object graphs like these?