@Override
public void serialize( @NotNull T object, @NotNull OutputStream out, @Nullable Lookup context ) throws IOException {
try {
SMOutputDocument doc = StaxSupport.getSmOutputFactory().createOutputDocument( out );
// doc.setIndentation( "\n ", 1, 2 );
SMOutputElement root = doc.addElement( getDefaultElementName() );
serialize( root, object, context != null ? context : Lookups.emtyLookup() );
doc.closeRoot();
} catch ( XMLStreamException e ) {
throw new IOException( e );
}