Search xml

Hi all!

I’m trying to search in a xml that looks like this:


<?xml version="1.0" encoding="utf-8"?>
<r2>
  <info>
    <part_name>top</part_name>
    <part_main_parent>top</part_main_parent>
    <sequence>overview</sequence>
    <cam_to_sequence>camride_to_overview</cam_to_sequence>
    <singleFrame>yes</singleFrame>
    <thumbs>dummy,dummy</thumbs>
    <buttons>btnCoreBarrel_mc,btnPrz_mc</buttons>
  </info>
  <children>
    <core_barrel>
      <info>
        <part_name>Core barrel</part_name>
        <part_main_parent>overview</part_main_parent>
        <sequence>core_barrel</sequence>
        <cam_to_sequence>camride_to_upper_internals</cam_to_sequence>
        <singleFrame>no</singleFrame>
        <thumbs>core_barrel/1/thumb.jpg,core_barrel/2/thumb.jpg</thumbs>
        <buttons>btnUpperInternals_mc,btnMainCore_mc</buttons>
      </info>
      <children>
        <lower_internals>
          <info>
            <part_name>Lower internals</part_name>
            <part_main_parent>tank</part_main_parent>
            <sequence>main_core</sequence>
            <cam_to_sequence>camride_to_main_core</cam_to_sequence>
            <singleFrame>yes</singleFrame>
            <thumbs>main_core/1/thumb.jpg,main_core/2/thumb.jpg</thumbs>
            <buttons>btnUpperCore_mc,btnLowerCore_mc,btnBottom_mc</buttons>
          </info>
          <children>
            <upper_core_barrel>
              <info>
                <part_name>Upper core barrel</part_name>
                <part_main_parent>tank</part_main_parent>
                <sequence>upper_internals</sequence>
                <cam_to_sequence>camride_to_upper_internals</cam_to_sequence>
                <singleFrame>yes</singleFrame>
                <thumbs>upper_internals/1/thumb.jpg,upper_internals/2/thumb.jpg</thumbs>
                <buttons>btnUpperInternalsCable_mc,btnUpperInternalsTubes_mc,btnUpperInternalsBottom_mc</buttons>
              </info>
              <children></children>
            </upper_core_barrel>
            <lower_core_plate>
              <info>
                <part_name>Lower core plate</part_name>
                <part_main_parent>tank</part_main_parent>
                <sequence>bottom</sequence>
                <cam_to_sequence>camride_to_bottom</cam_to_sequence>
                <singleFrame>no</singleFrame>
                <thumbs>bottom/1/thumb.jpg,bottom/2/thumb.jpg</thumbs>
                <buttons>btnGap_mc</buttons>
              </info>
              <children></children>
            </lower_core_plate>
          </children>
        </lower_internals>
      </children>
    </core_barrel>
  </children>
</r2>

I want the user to be able to search in all the “part_name” nodes by typing in a textfield by first make a list by using .descendants(part_name)
Then search through that list with the search() to be able to list the results in realtime. When the user clicks on one of the results (and this is where I fail) I want to be able to find that node in the xml and also get the entire hierarchy from that node all the way up to the top parent. I have tied for days but can’t seem to manage. Can someone please help me? I would be so great full!

Have a nice day!