# Model Behaviors Templates A **template** can be defined directly under any [``](../../../model-xml-properties/#Behaviors) or [``](../../../model-xml-properties/#CompileBehaviors) node, and it consists of an identifier specified with the attribute name and a "body" where we specify what the template does. For example: ``` xml ``` The goal of creating and using a template is to define base **components** (like [``](../../../animation-xml-properties/#MouseRect), [``](../../../animation-xml-properties/#Animation), etc..). A component definition consist of a lot of parameters, many of which can simply have a few default parameters. Therefor a template is the interface that allows you to use these default values while hiding most of the component parameters behind behavior [``](../../general-template-xml-properties/#Parameters).     ### Using A Template To make use of a defined template we use the node [``](../../general-template-xml-properties/#UseTemplate) which takes the name of the template to be included as an argument. Any content defined within the `` node will be parsed as parameters with an override rule. We discuss this in more detail on the following page ([Default Templates](default-templates/)), but let's just take a quick look at an example, using the XML posted above, to create an animation: ``` xml An_Animation_ID (L:XMLVAR_My_Lever_Position, percent) An_Other_Animation_ID (A:ELEVATOR DEFLECTION PCT, percent) 100 + 2 / 100 ```   What makes using the template system so special, is the use of **conditional statements** (using [Program Template Definitions](../../program-template-xml-properties/)). With this system you can easily use a template or an other based on a parameter specification, changing radically the created component properties ``` xml ```   One of the XML programming elements in particular is very useful: [``](../../program-template-xml-properties/#Loop). This element allows the simplification of repetitive `` statements, for example: ``` xml MAP_MODE <1>WXR <2>STA <3>WPT <4>ARPT <5>DATA <6>POS <7>TERR A_GLTF_NODE_PUSH_#MAP_MODE# (>H:Plane_MFD_MAP_#MAP_MODE#) ```