@Override
public void serialize( SMOutputElement serializeTo, Car object, Version formatVersion ) throws IOException, XMLStreamException {
assert isVersionWritable( formatVersion );
SMOutputElement colorElement = serializeTo.addElement( serializeTo.getNamespace(), "color" ); //okay, should be a own serializer in real world...
colorElement.addAttribute( "red", String.valueOf( object.getColor().getRed() ) );
colorElement.addAttribute( "blue", String.valueOf( object.getColor().getBlue() ) );
colorElement.addAttribute( "green", String.valueOf( object.getColor().getGreen() ) );
serialize( object.getModel(), Model.class, serializeTo.addElement( serializeTo.getNamespace(), "model" ), formatVersion );
serialize( object.getBasePrice(), Money.class, serializeTo.addElement( serializeTo.getNamespace(), "basePrice" ), formatVersion );