## collect_structure_map_artifacts()


Collect the StructureMap and all its dependent RepresentationMaps.


Usage

``` python
collect_structure_map_artifacts(
    structure_map,
    convert_to_urns=True,
)
```


When a StructureMap contains RepresentationMap objects, this function extracts them and converts the StructureMap to use URN references.


## Parameters


`structure_map: StructureMap`  
The StructureMap to process.

`convert_to_urns: bool = ``True`  
If True, converts embedded RepresentationMap objects to URN references in the output StructureMap. Defaults to True.


## Returns


`list[MaintainableArtefact]`  
A list containing RepresentationMaps followed by the StructureMap.


## Examples

``` python
    >>> from pysdmx.io import write_sdmx
    >>> from pysdmx.io.format import Format
    >>>
    >>> # Collect all artifacts
    >>> artifacts = collect_structure_map_artifacts(my_structure_map)
    >>>
    >>> # Write them all together
    >>> xml = write_sdmx(
    ...     artifacts,
    ...     sdmx_format=Format.STRUCTURE_SDMX_ML_3_0,
    ...     prettyprint=True
    ... )
```
