# bundle Field

The **\<bundle>** is a container field, which aggregates multiple independent fields (of any kind) into a single one. The **\<bundle>** field has all the [common](common) properties.

## Member Fields

Member fields need to be listed as children XML elements of the **\<bundle>**.

```
<?xml version="1.0" encoding="UTF-8"?>
<schema name="MyProtocol" endian="big">
    <fields>
        <bundle name="SomeBundle">
            <int name="SomeIntMember" type="uint8" />
            <set name="SomeSetMember" length="1">
                ...
            </set>
            <enum name="SomeEnumMember" type="uint8">
                ...
            </enum>
            <bundle name="SomeInnerBundle">
                ...
            </bundle>
        </bundle>
    </fields>
</schema>
```

If there is any other [property](../properties) defined as XML child of the **\<bundle>**, then all the members must be wrapped in **\<members>** XML element for separation.

```
<?xml version="1.0" encoding="UTF-8"?>
<schema name="MyProtocol" endian="big">
    <fields>
        <bundle name="SomeBundle">
            <displayName value="Proper Bundle Name" />
            <members>
                <int name="SomeIntMember" type="uint8" bitLength="3" />
                <set name="SomeSetMember" length="1">
                    ...
                </set>
                <enum name="SomeEnumMember" type="uint8">
                    ...
                </enum>
                <bundle name="SomeInnerBundle">
                    ...
                </bundle>
            </members>
        </bundle>
    </fields>
</schema>
```

## Reusing Other Bundle

Like any other field, **\<bundle>** supports **reuse** of any other **\<bundle>**. Such reuse copies all the fields from original **\<bundle>** in addition to all the properties. Any new defined member field gets **appended** to the copied ones.

```
<?xml version="1.0" encoding="UTF-8"?>
<schema name="MyProtocol" endian="big">
    <fields>
        <bundle name="SomeBundle">
            <int name="F1" type="uint32" />
            <float name="F2" type="float" />
        </bundle>

        <bundle name="SomeOtherBundle" reuse="SomeBundle">
            <string name="F3" length="16" />
        </bundle>        
    </fields>
</schema>
```

In the example above _SomeOtherBundle_ has **3** member fields: _F1_, _F2_, and _F3_.

## Alias Names to Member Fields

Sometimes an existing member field may be renamed and/or moved. It is possible to create alias names for the fields to keep the old client code being able to compile and work. Please refer to [Aliases](../aliases) chapter for more details.

Use [properties table](../appendix/bundle) for future references.
