I asked this question which led me to do the following.
- Create an XML representation of a C# object structure in order to pass it to SQLServer.
- Create a stored procedure which hashes the XML and then shreds the XML into related tables and also stores the hash in the root table for quick lookup.
- Normalise the XML by putting all attributes in alphabetical order
- use .ToString(DisableFormatting) to remove extra formatting spaces