Tags give you the power to do pretty much anything you want in a tag. You can pass in parameters via attributes. You can access the actual dom model and modify the document before the body is processed. The tagfile object is actually a tag that loads the template file and includes it in the main xml document modifying it on the fly.
Most of those uses are beyond the scope of this document, but let's create a simple tag that has a required and optional attribute that are used in the body of the tag.
Tags can specify a start() method and end() method. They also have access to a member variable $node which contains the current node.
There are two helper functions getRequiredAttribute and getOptionalAttribute that can be used to get attributes for the current node.
We can now refer to this tag like so:
<simpleTag:simpleTag name="myName">myValue</simpleTag:simpleTag> Output: <input name="myName" value="myValue" /> <simpleTag:simpleTag name="myName" size="10" >myValue</simpleTag:simpleTag> Output: <input name="myName" size="10" value="myValue" />