code: def parse_xml(self, node):
          
  
          def read_points(text):
              """parse a text string of float tuples and return [(x,...),...]
              """
              return tuple(tuple(map(float, i.split(','))) for i in text.split())
  
          self._set_properties(node)
  
          # correctly handle "tile objects" (object with gid set)
          if self.gid:
              self.gid = self.parent.register_gid(self.gid)
  
          points = None
          polygon = node.find('polygon')
          if polygon is not None:
              points = read_points(polygon.get('points'))
              self.closed = True
  
          polyline = node.find('polyline')
          if polyline is not None:
              points = read_points(polyline.get('points'))
              self.closed = False
  
          if points:
              x1 = x2 = y1 = y2 = 0
              for x, y in points:
                  if x < x1: x1 = x
                  if x > x2: x2 = x
                  if y < y1: y1 = y
                  if y > y2: y2 = y
              self.width = abs(x1) + abs(x2)
              self.height = abs(y1) + abs(y2)
              self.points = tuple(
                  [(i[0] + self.x, i[1] + self.y) for i in points])
  
          return self
docs: Parse an Object from ElementTree xml node
  
          :param node: ElementTree xml node
          :return: self