text: from dataclasses import dataclass, field
  from typing import List, Optional
  
  __NAMESPACE__ = "http://xsdtesting"
  
  
  @dataclass
  class Ct1:
      class Meta:
          name = "ct1"
  
      foo: List[object] = field(
          default_factory=list,
          metadata={
              "type": "Element",
              "namespace": "",
              "min_occurs": 2,
              "max_occurs": 5,
          }
      )
      bar: Optional[object] = field(
          default=None,
          metadata={
              "type": "Element",
              "namespace": "http://xsdtesting",
          }
      )
  
  
  @dataclass
  class Ct2:
      class Meta:
          name = "ct2"
  
      foo: Optional[object] = field(
          default=None,
          metadata={
              "type": "Element",
              "namespace": "",
          }
      )
      bar: Optional[object] = field(
          default=None,
          metadata={
              "type": "Element",
              "namespace": "",
          }
      )
  
  
  @dataclass
  class B:
      e1: List[Ct1] = field(
          default_factory=list,
          metadata={
              "type": "Element",
              "namespace": "",
              "min_occurs": 1,
              "max_occurs": 9,
              "sequential": True,
          }
      )
      e2: List[object] = field(
          default_factory=list,
          metadata={
              "type": "Element",
              "namespace": "",
              "min_occurs": 1,
              "max_occurs": 9,
              "sequential": True,
          }
      )
      e3: List[object] = field(
          default_factory=list,
          metadata={
              "type": "Element",
              "namespace": "",
              "min_occurs": 1,
              "max_occurs": 9,
              "sequential": True,
          }
      )
  
  
  @dataclass
  class Ct3(Ct1):
      class Meta:
          name = "ct3"
  
  
  @dataclass
  class R:
      e1: Optional[Ct3] = field(
          default=None,
          metadata={
              "type": "Element",
              "namespace": "",
              "required": True,
          }
      )
      e2: Optional[object] = field(
          default=None,
          metadata={
              "type": "Element",
              "namespace": "",
          }
      )
      e3: Optional[object] = field(
          default=None,
          metadata={
              "type": "Element",
              "namespace": "",
          }
      )
  
  
  @dataclass
  class Doc:
      class Meta:
          name = "doc"
          namespace = "http://xsdtesting"
  
      elem: Optional[R] = field(
          default=None,
          metadata={
              "type": "Element",
              "namespace": "",
          }
      )
  