title: Traverse xml in javascript
body: <p>I have an xml which is of the below format:</p>
  
  <pre><code>Xml:
  &lt;JobsArray&gt;
  &lt;TechJobs&gt;
   &lt;JobsAtSite&gt;
    &lt;SiteJob&gt;
      &lt;JobId&gt;100&lt;/JobId&gt;
      &lt;Name&gt;1bc&lt;/Name&gt;
    &lt;/SiteJob&gt;
    &lt;SiteJob&gt;
      &lt;JobId&gt;101&lt;/JobId&gt;
      &lt;Name&gt;abc&lt;/Name&gt;
    &lt;/SiteJob&gt;
    &lt;SiteJob&gt;
      &lt;JobId&gt;102&lt;/JobId&gt;
      &lt;Name&gt;xbc&lt;/Name&gt;
    &lt;/SiteJob&gt;
   &lt;/JobsAtSite&gt;
  &lt;TechJobSite&gt;
    &lt;JobsAtSite&gt;
     &lt;SiteJob&gt;
      &lt;JobId&gt;200&lt;/JobId&gt;
      &lt;Name&gt;1bc&lt;/Name&gt;
     &lt;/SiteJob&gt;
    &lt;/JobsAtSite&gt;
  &lt;/TechJobSite&gt;
  &lt;/JobsArray&gt;
  </code></pre>
  
  <p>I want those jobs where the JobId is not equal to 100 for the same  node. So the output should be in the below format:</p>
  
  <pre><code>&lt;TechJobs&gt;
   &lt;JobsAtSite&gt;
    &lt;SiteJob&gt;
      &lt;JobId&gt;101&lt;/JobId&gt;
      &lt;Name&gt;abc&lt;/Name&gt;
    &lt;/SiteJob&gt;
    &lt;SiteJob&gt;
      &lt;JobId&gt;102&lt;/JobId&gt;
      &lt;Name&gt;xbc&lt;/Name&gt;
    &lt;/SiteJob&gt;
   &lt;/JobsAtSite&gt;
  &lt;TechJobSite&gt;
  </code></pre>
  
  <p>This is the workaround which i had, but it is not giving me the expected result.</p>
  
  <pre><code>$(xml).find("SiteJob").filter(function () {
      return $(this).find("JobId").text().toLowerCase() !== "100";
  }).each(function () {
      console.log($(this).parent());
  });
  </code></pre>
  
  <p>Any fixes for this. Thanks.</p>