Formatting XML in SQL 2005 to include version
-
I have a SQL query that outputs well formed XML SELECT Title,Description FROM dbo.Books FOR XML PATH('item'), ROOT('channel') The output look like the following "channel" "item" "title"Study Guide For College Physics II"/title" "description"This course is divided into four..."/description" "/item" "item" "title"God bless America"/title" "description"Americans went off to war in World War.."/description" "/item" "/channel" What I need is the xml version, namespace so I can automate this process. Like so Had to strip out tags as they are filtered "xml version="1.0"" "rss version="2.0" "xmlns:live="http://live.com/schema/media/" "channel" "item" "title"Study Guide For College Physics II"/title" "description"This course is divided into four..."/description" "/item" "item" "title"God bless America"/title" "description"Americans went off to war in World War.."/description" "/item" "/channel"