title: Convert XML to Object using jQuery of plain javascript
body: <p>Here is a sample XML:</p>
  
  <pre><code>&lt;xml id="javascriptObject"&gt;
    &lt;name&gt;Joe&lt;/name&gt;
    &lt;age&gt;12&lt;/age&gt;
    &lt;gender&gt;M&lt;/gender&gt;
  &lt;/xml&gt;
  </code></pre>
  
  <p>Object produced after digesting the XML above should be equivalent to:</p>
  
  <pre><code>var obj = {name: 'Joe', age: '12', gender: 'M'};
  </code></pre>
  
  <p>You guys know any functions in javascript or in jQuery that will convert the XML to a javascript object? If none, any ideas on how to do this the best way as possible? Thanks guys!</p>