title: jQuery traversing XML find parent and children from node with spesific value
body: <p>I need to traverse an XML file and select a specific node  (and all its children) which contains a child node like </p>
  
  <pre><code>&lt;ssn&gt;11036026534&lt;/ssn&gt;
  </code></pre>
  
  <p>My aim is to read out the data as $('username',this).text() such that I am able to get all child nodes from the selected </p>
  
  <pre><code>&lt;person&gt; and down.
  </code></pre>
  
  <p>I have tried multiple ways of traversing, with no success - the most recent:</p>
  
  <pre><code>$(xml).each('person').find('ssn'["06106131859"]).parent( function () {
                console.log('ssn match for person')
            });
  </code></pre>
  
  <p>(which also gave me a jquery error) and</p>
  
  <pre><code>$(xml).find('ssn[06106131859]').parent().each( function () {...
  </code></pre>
  
  <p>I would greatly appreciate some help to move forward with this..have a great day!</p>
  
  <pre><code>&lt;person personIdHRM="10945"&gt;&lt;/person&gt;
  &lt;person personIdHRM="11538"&gt;&lt;/person&gt;
  &lt;person personIdHRM="1346"&gt;&lt;/person&gt;
  &lt;person personIdHRM="23456"&gt;
      &lt;authentication&gt;
          &lt;userId&gt;7260132&lt;/userId&gt;
          &lt;username&gt;Petter Smart&lt;/username&gt;
      &lt;/authentication&gt;
      &lt;employments&gt;
          &lt;employment&gt;
          &lt;employeeId&gt;18220&lt;/employeeId&gt;
          &lt;employmentPercentage&gt;100.0&lt;/employmentPercentage&gt;
          &lt;lastEmployeed&gt;2003-11-12&lt;/lastEmployeed&gt;
        &lt;positions&gt;
          &lt;position isPrimaryPosition="false" validFromDate="2015-01-01"&gt;
              &lt;positionPercentage&gt;0.0&lt;/positionPercentage&gt;
              &lt;positionStartDate&gt;2015-01-01&lt;/positionStartDate&gt;
          &lt;/position&gt;
          &lt;position isPrimaryPosition="true" validFromDate="2015-01-01"&gt;
              &lt;positionPercentage&gt;100.0&lt;/positionPercentage&gt;
              &lt;positionStartDate&gt;2015-01-01&lt;/positionStartDate&gt;
          &lt;/position&gt;
        &lt;/positions&gt;
      &lt;startDate&gt;2003-11-12&lt;/startDate&gt;
      &lt;/employment&gt;
    &lt;/employments&gt;
    &lt;familyName&gt;Hanson&lt;/familyName&gt;
    &lt;genderCode&gt;FEMALE&lt;/genderCode&gt;
    &lt;givenName&gt;Elizabeth&lt;/givenName&gt;
    &lt;hrmAuthentications /&gt;
    &lt;ssn&gt;06106131859&lt;/ssn&gt;
  &lt;/person&gt;
  </code></pre>