Here’s an interesting approach for creating a quick and dirty schema to get you started with XML.
DECLARE @schema xml
SET @schema = (SELECT * FROM schema.TABLE FOR XML AUTO, ELEMENTS,
XMLSCHEMA('SchemaName'))
SELECT @schema
SET @schema = (SELECT * FROM schema.TABLE FOR XML AUTO, ELEMENTS,
XMLSCHEMA('SchemaName'))
SELECT @schema
I don’t have the source, but I have where I found it.