}
try {
InputSource fodoc = S9apiUtils.xdmToInputSource(runtime, doc);
SAXSource source = new SAXSource(fodoc);
xep.render(source, new FOTarget(out, outputFormat));
} catch (Exception e) {
throw new XProcException(step.getNode(), "Failed to process FO document with XEP", e);
} finally {
xep.cleanup();
}