title: Get parent element node when child node is matched
body: <p>This is my code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
  var xml;
  $.get(
      "code.xml",  
      function(data) { xml=data; },
      "html"
  );
  function get_list(){
    xmlDoc = $.parseXML( xml ),
    $xml = $( xmlDoc ),
    $title = $xml.find('[value="'+$('#select').val()+'"]');
    $nodes = $title.find('*');
    var result='';
    $nodes.each(function(){
      result += $(this).attr('value');
      result += ' ';
    });
    $("#result").html(result);
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;input type="text" id="select"&gt;
  &lt;input type="button" name="button" value="Search" onclick="get_list()" &gt;
  &lt;div id="result"&gt;
  &lt;/div&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my <code>xml</code> file:</p>
  
  <pre><code> &lt;root&gt;
      &lt;child_1 entity_id = "1" value="india"&gt;
          &lt;child_2 entity_id = "2" value="gujarat"&gt;
              &lt;child_3 entity_id = "3" value="Ahemdabad"/&gt;
              &lt;child_4 entity_id = "4" value="Surat"/&gt;
              &lt;child_5 entity_id = "5" value="Rajkot"/&gt;           
          &lt;/child_2&gt;
      &lt;/child_1&gt;
      &lt;child_6 entity_id = "6" value="Rasia"&gt;
          &lt;child_7 entity_id = "7" value="state"&gt;
              &lt;child_8 entity_id = "8" value="cty"/&gt;
              &lt;child_9 entity_id = "9" value="cty1"/&gt;
              &lt;child_10 entity_id = "10" value="cty2"/&gt;           
          &lt;/child_2&gt;
      &lt;/child_6&gt;
  &lt;/root&gt;
  </code></pre>
  
  <blockquote>
    <p><em>With this code I get the <code>child node value</code>.</em></p>
  </blockquote>
  
  <p>I wanted something, like  when i enter in <code>textbox</code> any of <em>city name</em>: <strong>Ahemdabad</strong>, <strong>Surat</strong>, <strong>Rajkot</strong>; then its match on my xml file returns me <code>country name</code> like <strong>India</strong>. <br></p>
  
  <p>Thanks!</p>