def to_xml(self):
        '''
        Returns a DOM representation of the group.
        @return: Element
        '''
        if not len(self.lines):
            raise GroupError("A group must at least have one line.")

        doc = Document()
        root = doc.createElement("group")
        super(Group, self).to_xml(root)
        self._create_text_node(root, "name", self.name, True)
        self._create_text_node(root, "description", self.description, True)

        lines = doc.createElement("lines")
        root.appendChild(lines)
        for line in self.__lines:
            if not issubclass(line.__class__, Line):
                raise GroupError('line of type %s is not an instance ' \
                                     'or a subclass of %s' %
                                     (line.__class__.__name__, Line.__name__))
            lines.appendChild(line.to_xml())

        return root
def to_xml ( self ) : if not len ( self . lines ) : raise GroupError ( "A group must at least have one line." ) doc = Document ( ) root = doc . createElement ( "group" ) super ( Group , self ) . to_xml ( root ) self . _create_text_node ( root , "name" , self . name , True ) self . _create_text_node ( root , "description" , self . description , True ) lines = doc . createElement ( "lines" ) root . appendChild ( lines ) for line in self . __lines : if not issubclass ( line . __class__ , Line ) : raise GroupError ( 'line of type %s is not an instance ' 'or a subclass of %s' % ( line . __class__ . __name__ , Line . __name__ ) ) lines . appendChild ( line . to_xml ( ) ) return root
Returns a DOM representation of the group.
        @return: Element