Sort complex types, and add XML Schema type generation