title: Flex4 finding the name of the selected XML item
body: <p>I have an XML object in Flex4 that is populating a tree (amongst other things).</p>
  
  <p>I need to be able to find the name of the selected item when it is clicked in the tree.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;Object id=""&gt;
  &lt;Image&gt;&lt;/Image&gt;
  &lt;Cycle&gt;&lt;/Cycle&gt;
  &lt;/Object&gt;
  &lt;Action&gt;
  &lt;Hide&gt;&lt;/Hide&gt;
  &lt;/Action&gt;
  </code></pre>
  
  <p>The tags are all predefnied by me so I will know what they are, but I need to be able to know if the item a user has selected is "Object" and do something, or if they select "Action" do something else.</p>
  
  <p>What is the syntax to get the names of these in flex4 and compare them?</p>
  
  <p>Thanks</p>