public void serialize( @NotNull SMOutputElement serializeTo, @NotNull FileType object ) throws IOException, XMLStreamException {
serializeTo.addAttribute( ATTRIBUTE_DEPENDENT, String.valueOf( object.isDependentType() ) );
serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_ID ).addCharacters( object.getId() );
for ( Extension extension : object.getExtensions() ) {
SMOutputElement extensionElement = serializeTo.addElement( serializeTo.getNamespace(), ELEMENT_EXTENSION );
if ( object.isDefaultExtension( extension ) ) {
extensionElement.addAttribute( ATTRIBUTE_DEFAULT, String.valueOf( true ) );
}
serialize( extension, Extension.class, extensionElement );
}
}