[ORB-321] fixed bug in getAllOptionalElements() method (was using default=1 rather than required=1 to determine optional state)