You shouldn 't need an Object Factory. Once you have your root XML elements properly annotated with @XMLRootElement that should be fine and enough.
Cheers,
You are right. I deleted ObjectFactory class and it still works. Thanks.
P.S. Even though I have always had @XmlRootElement annotated classes, it did not work when I was using "java:java.lang.String" in sy:transforms. Only when I changed the transform's configuration to wrapped classes (which exactly have that annotation) it started working.