Query XML with dynamic number of elements or attributes?
<p>I have employee table in sql database which has some fixed attributes like employee_id, employee_name and employee_age, I allow user to add n attributes of his choice in UI. I want to write a stored procedure to store the data which user provides for fixed attributes as well as the attributes which he has created.</p>

<p>The solution which i thought was to pass the xml as parameter to stored procedure which will have the following structure. If employee_age is not provided, then its default value is stored.</p>

<pre><code>&lt;employee&gt;
  &lt;employee_id&gt;1&lt;employee_id&gt;
  &lt;employee_name&gt;XYZ&lt;employee_name&gt;
  &lt;dynamic_attrib1&gt;2.34&lt;/dynamic_attrib1&gt;
  &lt;dynamic_attrib2&gt;abcd&lt;/dynamic_attrib2&gt;
&lt;employee&gt;
</code></pre>

<p>the problem which i am facing is how to parse this xml when i dont know the names of attributes which user is setting in advance? Can i do it this way? Is there any other way in which i can do it? Thanks in advance.. :)</p>