It is very easy to serialize Java object to a string using something like:
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
...
public void serialize() throws Exception {
MyPojo object = new MyPojo();
String xml = new XmlMapper().writeValueAsString(object);
}
But I have difficulties understanding how to get org.w3c.dom.Document or javax.xml.transform.dom.DOMResult as a result of this serialization (because I'll be doing XSLT transformation immediately after so I'd like to avoid unnecessary string conversions)?