Let's look at a simple rule with two conditions. The conditions are enclosed in a <conditions> tag which is placed directly inside the <rule> tag. Each condition is placed inside the <conditions> tag.

<vbox datasources="http://www.xulplanet.com/ds/sample.rdf"
         ref="http://www.xulplanet.com/rdf/A" hidden="true">
  <template>
    <rule>
      <conditions>
        <content uri="?start"/>
        <triple subject="?start"/>
                predicate="http://www.xulplanet.com/rdf/relatedItem"/>
                object="?relateditem"/>
      </conditions>
      ...
    </rule>
  </template>
</vbox>

This rule has two conditions, each specified with a different tag. The template won't generate anything yet since we still need to fill in the content to be generated which goes in the missing part after the conditions. However, the template builder will be able to compile the rules and examine them as described earlier.

The builder needs to start with a single result as the seed result. This is done with the <content> tag. It indicates that we are going to use a starting point when navigating the graph. Obviously, since you need to start somewhere, you will have to use a <content> tag and it should be the first condition. Also, because we can only have one starting point, only one <content> tag can be used. The seed result will be created like this:

(?start = http://www.xulplanet.com/rdf/A)

The variable ?start is determined from the tag's 'uri' attribute. You can use any variable you want; it's common to use the variable ?uri. However, all rules must use the same starting point variable. So if a second rule were used, it would also need to use the ?start variable. The value of ?start is set to 'http://www.xulplanet.com/rdf/A'. You'll notice that this is the value of the ref attribute which is the desired starting node in the RDF graph. Thus, the ?start variable becomes the container or reference variable.

The <content> tag doesn't do anything else at this point, meaning it doesn't add anything else to the network of potential results, so processing continues on to the next condition, the <triple>

Actually, in the current templates implmentation, the above description isn't quite correct. The seed is a actually an internal variable set to the container, in this case, the <vbox>, and the ?start variable is set to the ref later, but that is a minor detail that doesn't make templates more understandable. For this discussion, assume that so far we have a single potential result as above.