# - - - H i e r . w r i t e X M L def writeXML ( self, parent ): '''Generate an XML representation of self. '''
The root element of the subtree for a hierarchy is
rankSet. Its children are
rank elements that will be added
by Section 16.3, “
Rank.writeXML(): Generate XML”.
#-- 1 -- # [ parent := parent with a new rnc.RANK_SET_N element added # rankSet := that new element ] rankSet = E ( rnc.RANK_SET_N ) parent.append ( rankSet ) #-- 2 -- # [ rankSet := rankSet with rnc.RANK_N elements added # representing the ranks in self ] for rank in self: rank.writeXML ( rankSet )