I managed to do this using the same schema used in the unedifact:reader
Smooks-config:
<?xml version="1.0"?>
<smooks-resource-list xmlns="http://www.milyn.org/xsd/smooks-1.1.xsd"
xmlns:core="http://www.milyn.org/xsd/smooks/smooks-core-1.4.xsd">
<import file="/org/milyn/edi/unedifact/d96a/message-bindingconfig.xml" />
<import file="/org/milyn/smooks/edi/unedifact/model/r41/bindings/unedifact-interchange.xml" />
<core:exports>
<core:result type="org.milyn.payload.JavaResult"/>
</core:exports>
</smooks-resource-list>
The result is a HashMap withe the elements readed. Now that i have objets i can make any modifications and after that i use the document interchange factory: ex D96AInterchangeFactory
D96AInterchangeFactory factory = D96AInterchangeFactory.getInstance();
UNEdifactInterchange41 unEdifactInterchange = (UNEdifactInterchange41) map.get("unEdifactInterchange");
StringWriter ediOutStream = new StringWriter();
factory.toUNEdifact(unEdifactInterchange, ediOutStream);
Finally i can use toString() to get my document:
System.out.println("document: " + ediOutStream.toString());