def Add(self, display_surf, type, xmlObject):

        if type == 'text':
            line = xmlObject.firstChild.data

            words = line.split(' ')

            self.bloc.append(words)
            self.tipus.append('text')

            for word in words:
                tmpSurf = self.font.render(word, 1, Constants.colorBlack)
                surf = pygame.Surface((self.font.size(word))).convert()
                surf.fill(self.backgroundColor)
                if (self.xActCell +
                        self.font.size(word)[0]) > self.Rect.width - 10:
                    self.xActCell = self.X_NEW_LINE
                    self.yActCell += self.OFFSET_TOP_NEW_LINE

                surf.blit(tmpSurf, (0, 0))

                rect = pygame.Rect((self.xActCell, self.yActCell),
                                   (surf.get_size()))
                textCell = TextCell(rect, self.idCell, 'text')

                contentCell = ContentCell()
                contentCell.img = surf.copy()
                if (self.isOrder != None):
                    contentCell.id = None
                else:
                    contentCell.id = self.idCell
                    self.idCell = self.idCell + 1
                textCell.contentCell = contentCell

                self.textCells.append(textCell)

                #self.idCell = self.idCell + 1
                self.xActCell += rect.width + 5
                if self.xActCell >= self.Rect.width - 10:
                    self.xActCell = self.X_NEW_LINE
                    self.yActCell += self.OFFSET_TOP_NEW_LINE

        elif type == 'text2':

            if (xmlObject == '\n'):
                self.bloc.append('\n')
                self.tipus.append('return')

            else:
                line = xmlObject.firstChild.data

                try:
                    text = xmlObject.getElementsByTagName(
                        "text")[0].firstChild.data
                    line = text
                except:
                    pass

                words = line.split(' ')

                self.bloc.append(words)
                self.numeracio.append(self.numCells)
                self.tipus.append('text2')
                self.lenTipus2 += 1

                for word in words:
                    tmpSurf = self.font.render(word, 1, Constants.colorLila)
                    surf = pygame.Surface((self.font.size(word))).convert()
                    surf.fill(Constants.colorBlack)
                    if (self.xActCell +
                            self.font.size(word)[0]) > self.Rect.width - 10:
                        self.xActCell = self.X_NEW_LINE
                        self.yActCell += self.OFFSET_TOP_NEW_LINE

                    surf.blit(tmpSurf, (0, 0))

                    rect = pygame.Rect((self.xActCell, self.yActCell),
                                       (surf.get_size()))
                    textCell = TextCell(rect, self.idCell, 'text')

                    contentCell = ContentCell()
                    contentCell.img = surf.copy()
                    contentCell.id = self.id
                    textCell.contentCell = contentCell

                    textCell.contentCell.id = self.id

                    self.textCells2.append(textCell)

                    self.numCells += 1

                    #self.idCell = self.idCell + 1
                    self.xActCell += rect.width + 5
                    if self.xActCell >= self.Rect.width - 10:
                        self.xActCell = self.X_NEW_LINE
                        self.yActCell += self.OFFSET_TOP_NEW_LINE

                self.ids.append(self.id)

                self.id += 1

        elif type == 'cell':
            try:
                width = int(xmlObject.getAttribute('width'))
                height = int(xmlObject.getAttribute('height'))
                image = xmlObject.getAttribute('image')
                image = self.mediaBag[image]
                fullPath = self.pathToMedia + '/' + image

                cellRect = pygame.Rect(self.xActCell, self.yActCell, width,
                                       height)
                cell = Cell(cellRect, display_surf, self.idCell, True)

                contentCell = ContentCell()
                contentCell.id = self.idCell
                contentCell.img = pygame.Surface((width, height))
                cellImg = pygame.image.load(fullPath).convert_alpha()
                cellImg = pygame.transform.scale(cellImg, (width, height))

                contentCell.img.blit(cellImg, (0, 0))
                cell.contentCell = contentCell

                self.textCells.append(cell)
                self.idCell += 1
                self.xActCell += width + int(
                    (Constants.ACTIVITY_WIDTH -
                     (self.numCells * width)) / self.numCells)
            except:
                pass

        elif type == 'textField':
            textField = TextField(xmlObject, self.font, self.backgroundColor)
            textField.Load(self.xActCell, self.yActCell, display_surf)
            textCell = TextCell(None, self.idCell, 'textField')
            textCell.contentCell = textField
            self.textCells.append(textCell)
            self.idCell += 1
            self.xActCell = self.X_NEW_LINE
            self.yActCell += textField.textCell.Rect.height + self.OFFSET_TOP_NEW_LINE

        elif type == 'target':
            try:
                '''Si el target es de tipus optionList'''
                xmlObject.getElementsByTagName('optionList')

                if (self.xActCell + Constants.widthOpt +
                        self.font.size('V')[0]) > self.Rect.width:
                    self.xActCell = self.X_NEW_LINE
                    self.yActCell += self.OFFSET_TOP_NEW_LINE

                option = OptionList(xmlObject, self.font)
                option.Load(self.xActCell, self.yActCell, display_surf)

                optionCell = TextCell(None, self.idCell, 'option')
                optionCell.contentCell = option

                self.textCells.append(optionCell)

                self.idCell = self.idCell + 1
                self.xActCell += option.textCell.Rect.width + option.openCell.Rect.width + 5
                if self.xActCell >= self.Rect.width:
                    self.xActCell = self.X_NEW_LINE
                    self.yActCell += self.OFFSET_TOP_NEW_LINE
                return
            except:
                print 'no es optionList'

            try:
                '''Si el target es de tipus response'''
                xmlObject.getElementsByTagName('response')
                print 'es de tipus response'
                resp = Response(xmlObject, self.font, self.backgroundColor)
                resp.Load(self.xActCell, self.yActCell, display_surf)

                respCell = TextCell(None, self.idCell, 'response')
                respCell.contentCell = resp

                self.textCells.append(respCell)

                self.idCell += 1
                self.xActCell += respCell.contentCell.totalWidth + 5
                if self.xActCell >= self.Rect.width:
                    self.xActCell = self.X_NEW_LINE
                    self.yActCell += self.OFFSET_TOP_NEW_LINE
                return
            except:
                print 'no es de tipus response'