Google

def root @children.find { |item| item.kind_of? Element } end