title: Finding an object in an XML database, feeding it's info to relevant DOM elements
body: <p>Apologies if the title does not make much sense; I'm a little new to this and not sure what the smartest way to phrase it is.</p>
  
  <p>I have a page that has a row of movie posters at the top. Clicking one of them should:</p>
  
  <ul>
  <li>Open an XML file with AJAX</li>
  <li>Find the object in the XML file with the same name as the movie poster clicked</li>
  <li>Populate the "template" in the page, using the movie info found within the XML object</li>
  </ul>
  
  <p>Here is an example snippet of XML:</p>
  
  <pre><code>&lt;movies&gt;
  &lt;movie name="se7en"&gt;
      &lt;title&gt;Se7en&lt;/title&gt;
      &lt;quote&gt;Ernest Hemingway once wrote;&lt;br&gt;“The world is a fine place and worth fighting for.”&lt;br&gt;I agree with the second part.&lt;/quote&gt;
      &lt;showing&gt;AUG 28, 3:45PM&lt;/showing&gt;
      &lt;rating&gt;R&lt;/rating&gt;
      &lt;year&gt;1995&lt;/year&gt;
      &lt;length&gt;127 Minutes&lt;/length&gt;
      &lt;genre&gt;Thirller&lt;/genre&gt;
      &lt;staring1&gt;Brad Pitt&lt;/staring1&gt;
      &lt;staring2&gt;Morgan Freeman&lt;/staring2&gt;
      &lt;staring3&gt;Gwyneth Paltrow&lt;/staring3&gt;
      &lt;staring4&gt;&lt;/staring4&gt;
      &lt;slogan&gt;7 deadly sins. 7 ways to die.&lt;/slogan&gt;
      &lt;synopsis&gt;&lt;p&gt;Set in a hellish vision of a New York-like city, where it is always raining and the air crackles with impending death, the film concerns Detective William Somerset (Morgan Freeman), a homicide specialist just one week from a well-deserved retirement.&lt;/p&gt;&lt;p&gt;But Somerset’s retirement must wait for one last case, for which he is teamed with young hotshot David Mills (Brad Pitt), the fiery det­ective set to replace him at the end of the week. Mills has talked his reluctant wife, Tracy (Gwyneth Paltrow), into moving to the big city so that he can tackle important cases, but his first and Somerset’s last are more than either man has bargained for. A diabolical serial killer is staging grisly murders, choosing victims representing the seven deadly sins. Somerset initially refuses to take the case, realizing that there will be five more murders, ghastly sermons about lust, sloth, pride, wrath, and envy presented by a madman to a sinful world. But something within him cannot let the case go, forcing the weary detective to team with Mills and see the case to its almost unspeakably horrible conclusion.&lt;/p&gt;&lt;/synopsis&gt;
  &lt;/movie&gt;
  &lt;movie name="thegame"&gt;
      &lt;title&gt;The Game&lt;/title&gt;
      &lt;quote&gt;foobar&lt;/quote&gt;
      &lt;showing&gt;foobar&lt;/showing&gt;
      &lt;rating&gt;foobar&lt;/rating&gt;
      &lt;year&gt;foobar&lt;/year&gt;
      &lt;length&gt;foobar&lt;/length&gt;
      &lt;genre&gt;foobar&lt;/genre&gt;
      &lt;staring1&gt;foobar&lt;/staring1&gt;
      &lt;staring2&gt;foobar&lt;/staring2&gt;
      &lt;staring3&gt;foobar&lt;/staring3&gt;
      &lt;staring4&gt;foobar&lt;/staring4&gt;
      &lt;slogan&gt;foobar&lt;/slogan&gt;
      &lt;synopsis&gt;foobar&lt;/synopsis&gt;
  &lt;/movie&gt;
  &lt;/movies&gt;
  </code></pre>
  
  <p>So, when clicking on the movie poster for "se7en", I would need to find the movie object with a name of "se7en" in the xml document. I would then take the content of the <code>&lt;title&gt;</code> tags under the "se7en" object, and put that into the relevant DOM element. Then, take the content of the <code>&lt;quote&gt;</code> tags under the "se7en" object, and put that into the relevant DOM element, etc, etc.</p>
  
  <p>So, I setup the AJAX request via</p>
  
  <pre><code>var noSpace = $(this).attr('data-title').replace(/\W/g,'').toLowerCase();
  
  var movieReq = new XMLHttpRequest();
  movieReq.open("GET","movies.xml?m="+noSpace,true);
  movieReq.send();
  movieXML = movieReq.responseXML;
  </code></pre>
  
  <p>(<code>noSpace</code> is the movie poster's name that we will be searching the XML for the relevant <code>&lt;movie&gt;</code> object for)</p>
  
  <p>But then, how do I search movieXML for <code>&lt;movie name=noSpace&gt;</code> and pull it's information?</p>
  
  <p>As I mentioned, I've never done an XMLHttpRequest before, and am having trouble understanding how it works. Is there a better way to accomplish the overall task I'm trying to do? Should I be using JSON instead of XML? I have no idea how this is best done.</p>
  
  <p>I have experience loading divs from an HTML document using </p>
  
  <pre><code>$('#xyz').load('foo.html #bar');
  </code></pre>
  
  <p>, but I'm not sure if that applies in anyway to what I'm doing here.</p>