def layout_title(layout):
 for child in layout.children:
  if isinstance(child, Title):
   return u' '.join([node.data for node in get_nodes(child, Text)])

def layout_title ( layout ) : for child in layout . children : if isinstance ( child , Title ) : return u' ' . join ( [ node . data for node in get_nodes ( child , Text ) ] )
try to return the layouts title as string .