<xpp>
<!-- Define the ancestor class XPlant
-->
<class name="XPlant" inherit="">
<construct>
<scope type="public">
<Num upd="false">100</Num>
</scope>
</construct>
<scope type="public">
<var type="int" name="iAge">5</var>
</scope>
</class>
<!-- Define the XTree class which
inherits from XPlant but adds nothing else -->
<class name="XTree" inherit="XPlant"/>
<!-- Instantiate the MyTree object as
an instance of XTree -->
<node name="MyTree" class="XTree" processcode="true" construct="true"/>
<!-- Write the iAge member of MyTree
in a sentence -->
<xout processcode="true">
<eval>
<parm type="int" name="Parm0">
<eval object="MyTree" member="iAge"/>
</parm>
<expr>"\r\nMyTree's
age is " + Parm0 + " years old."</expr>
</eval>
</xout>
<!-- Write the upd attribute of the
Num child node of the MyTree object -->
<xout processcode="true">
<eval>
<parm type="string" name="Parm0">
<eval object="MyTree/Num" attribute="upd"/>
</parm>
<expr>"\r\nMyTree/Num's
upd flag is " + Parm0</expr>
</eval>
</xout>
<!-- Assign the Barn node to be the
new value of MyTree -->
<eval object="MyTree">
<Barn>500</Barn>
</eval>
</xpp>