 <p>There are a couple of things here, largely for XML you're going to have to realize that proper XML is organized by a structure of node types. These types and their consistency is defined by the name of the node, so having a different node name for what are essentially the same type, is wrong. Consider this XML:</p> <pre><code>&lt;DocumentElement&gt; &lt;Folders&gt; &lt;Direction Key="folder0"&gt; &lt;question&gt; &lt;ask&gt;Which do you want to go?&lt;/ask&gt; &lt;answer go='folder1'&gt;Go to Left&lt;/answer&gt; &lt;answer go='folder2'&gt;Go to Right&lt;/answer&gt; &lt;/question&gt; &lt;/Direction&gt; &lt;Direction Key="folder1"&gt; &lt;question&gt; &lt;ask&gt;You went left.&lt;/ask&gt; &lt;answer go='finish1'&gt;Go to Finish&lt;/answer&gt; &lt;answer go='finish2'&gt;Go to Finish&lt;/answer&gt; &lt;/question&gt; &lt;/Direction&gt; &lt;/Folders&gt; &lt;Finishers&gt; &lt;finish key="finish1"&gt; &lt;role&gt; &lt;name&gt;Hello World&lt;/name&gt; &lt;description&gt;COOL THING&lt;/description&gt; &lt;/role&gt; &lt;/finish&gt; &lt;finish key="finish2"&gt; &lt;role&gt; &lt;name&gt;FINISH2&lt;/name&gt; &lt;description&gt;COOL THING 2&lt;/description&gt; &lt;/role&gt; &lt;/finish&gt; &lt;/Finishers&gt; &lt;/DocumentElement&gt; </code></pre> <p>Now, I don't fully understand what you are trying to do, so this probably isn't an accurate solution in terms of your <strong>specific</strong> needs, but my goal is to give you an understanding of how Xml works in terms of organizing your data.</p> <p>Your jQuery when using this structure can now be better organized by searching for Keys as attritbutes and node types by their name.</p>