Using data() function of jquery form nested data for DOM
<p>I am looking form a nested data to a DOM element. Something like this</p>

<pre><code>$("div").data( "test", { 
    first: 16,
    last: "pizza!"
});
</code></pre>

<p>Here is my effort to make similar kind of format. But RefAttrValue variable is not behaving as variable.</p>

<pre><code>for (var i = 0; i &lt; reference.attributes.length; i++) {
    var RefAttrValue = (reference.attributes.item(i).name);
    $(tableCaption).data("referenceData").RefAttrValue = reference.attributes.item(i).value;
}
</code></pre>

<p>Here the Values of the "reference" is a XML. Which has value like below or can contain any similar XML.</p>

<pre><code>&lt;facilityreference Name="qtitem_fac" AttrTable='table1' colVal='table1colValue'&gt;&lt;/facilityreference&gt;
</code></pre>

<p>I want to set up the <code>data()</code> format in this below format <strong>"Dynamically"</strong>.</p>

<pre><code>$("div").data("test",{ Name: "qtitem_fac", last: "table1colValue" });
</code></pre>

<p>Please help.</p>
