### Example XML Structure for pydantic-xml Model Source: https://pydantic-xml.readthedocs.io This XML structure corresponds to the 'Company' and 'Product' models defined using pydantic-xml. It demonstrates how attributes and element text are used to represent the data. ```xml https://www.spacex.com Several launch vehicles Starlink Starship ``` -------------------------------- ### Define XML Model Fields with pydantic-xml Source: https://pydantic-xml.readthedocs.io Use pydantic-xml's field decorators to bind model fields to XML attributes, elements, or text. This example shows how to extract data from XML attributes ('status', 'launched', 'trade-name'), element text ('website', 'title'), and nested elements ('products'). ```python class Product(BaseXmlModel): status: Literal['running', 'development'] = attr() # extracted from the 'status' attribute launched: Optional[int] = attr(default=None) # extracted from the 'launched' attribute title: str # extracted from the element text class Company(BaseXmlModel): trade_name: str = attr(name='trade-name') # extracted from the 'trade-name' attribute website: HttpUrl = element() # extracted from the 'website' element text products: List[Product] = element(tag='product', default=[]) # extracted from the 'Company' element's children ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.