converterLookup.registerConverter(new ToAttributedValueConverter(
X.class, mapper, reflectionProvider, converterLookup, "innerObj"), 0);
final X x = new X(42);
x.aStr = "xXx";
x.innerObj = new Y();
x.innerObj.yField = "inner";
final StringWriter writer = new StringWriter();
final CompactWriter compactWriter = new CompactWriter(writer);
new TreeMarshaller(compactWriter, converterLookup, mapper).start(x, null);
compactWriter.flush();