Have a look at vtm theme, to understand better:
https://github.com/mapsforge/vtm/blob/master/vtm-themes/resources/assets/vtm/default.xml
<m cat="contour" closed="no" e="way" k="contour_ext">
<m e="way" k="contour_ext" zoom-max="9">
<m e="way" k="contour_ext" v="elevation_major">
<line fix="true" stroke="#8E8072" width="0.3"/>
</m>
</m>
<m e="way" k="contour_ext" zoom-max="12" zoom-min="10">
<m e="way" k="contour_ext" v="elevation_medium">
<line fix="true" stroke="#8E8072" width="0.2"/>
</m>
<m e="way" k="contour_ext" v="elevation_major">
<line fix="true" stroke="#8E8072" width="0.5"/>
</m>
</m>
<m e="way" k="contour_ext" zoom-max="13" zoom-min="13">
<m e="way" k="contour_ext" v="elevation_minor">
<line fix="true" stroke="#8E8072" width="0.2"/>
</m>
<m e="way" k="contour_ext" v="elevation_medium|elevation_major">
<line fix="true" stroke="#8E8072" width="0.5"/>
</m>
</m>
<m e="way" k="contour_ext" zoom-max="14" zoom-min="14">
<m e="way" k="contour_ext" v="elevation_minor">
<line fix="true" stroke="#8E8072" width="0.15"/>
</m>
<m e="way" k="contour_ext" v="elevation_medium|elevation_major">
<line fix="true" stroke="#8E8072" width="0.4"/>
<text style="bold" fill="#6E5A46" k="ele" size="7" stroke="#E5FFFFFF"
stroke-width="1"/>
</m>
</m>
<m e="way" k="contour_ext" zoom-max="15" zoom-min="15">
<m e="way" k="contour_ext" v="elevation_minor">
<line fix="true" stroke="#8E8072" width="0.12"/>
</m>
<m e="way" k="contour_ext" v="elevation_medium|elevation_major">
<line fix="true" stroke="#8E8072" width="0.3"/>
<text style="bold" fill="#6E5A46" k="ele" size="8" stroke="#E5FFFFFF"
stroke-width="1"/>
</m>
</m>
<m e="way" k="contour_ext" zoom-max="16" zoom-min="16">
<m e="way" k="contour_ext" v="elevation_minor">
<line fix="true" stroke="#8E8072" width="0.08"/>
</m>
<m e="way" k="contour_ext" v="elevation_medium|elevation_major">
<line fix="true" stroke="#8E8072" width="0.2"/>
<text style="bold" fill="#6E5A46" k="ele" size="9" stroke="#E5FFFFFF"
stroke-width="2"/>
</m>
</m>
<m e="way" k="contour_ext" zoom-min="17">
<m e="way" k="contour_ext" v="elevation_minor">
<line fix="true" stroke="#8E8072" width="0.06"/>
</m>
<m e="way" k="contour_ext" v="elevation_medium|elevation_major">
<line fix="true" stroke="#8E8072" width="0.15"/>
<text style="bold" fill="#6E5A46" k="ele" size="9" stroke="#E5FFFFFF"
stroke-width="2"/>
</m>
</m>
</m>