def fold(self, predicate):
        """Takes a predicate and applies it to each node starting from the
        leaves and making the return value propagate."""
        childs = {x:y.fold(predicate) for (x,y) in self._attributes.items()
                  if isinstance(y, SerializableTypedAttributesHolder)}
        return predicate(self, childs)
Takes a predicate and applies it to each node starting from the
        leaves and making the return value propagate.