$file = join '_', map { $_->first_child_text('name') } $node->ancestors( 'node' ); # still need to add name from root/name