I have one XML column in SQL Server where I store actual value and immediate previous value of attributes. eg. Name
<attribute name="Name">
<actuals>
<element isPreferred="true" name="FirstName">Name 2</element>
<element isPreferred="false" name="LastName">N2</element>
</actuals>
<previous>
<element isPreferred="true" name="FirstName">Name 1</element>
<element isPreferred="false" name="LastName">N1</element>
</previous>
</attribute>
How can I show the history of attribute like
------------------------------------
Attribute | New Value | OldValue
------------------------------------
First Name| Name2 | Name1
Last Name | N2 | N1
------------------------------------
Attributes may vary and can have single element like gender or multiple elements like Name or Address(addressLine1, city, state, country)
<attribute name="Gender">
<actuals>
<element isPreferred="true" name="Gender">Male</element>
</actuals>
<previous>
<element isPreferred="true" name="Gender">Other</element>
</previous>
</attribute>