title: Convert HTML DOM into a multidimensional array
body: <p>Where keys are represented by element type and values are represented by <code>#foo</code> and <code>.bar</code> (spaced and ready for <code>explode()</code>). Is it possible, or does something exist for it?</p>
  
  <p>I know that this question might incite some wrath, and I'm hoping nobody links to that post about parsing HTML, but I'm hoping it's not impossible. Thanks for the help.</p>
  
  <p>Addendum: Ideally, PHP would be used, since it's the only scripting language I know.</p>