...
I want the xml to look like this:
<PartsList>
<123>
...
It is not valid XML. You cannot have element named as number.
One of XML Naming Rule is: Names cannot start with a number or punctuation character
http://www.w3schools.com/xml/xml_elements.asp
But if you still want it as non-XML text, you can do the following with Dwain solution:
DECLARE @t TABLE (Part INT, Color VARCHAR(10), Size VARCHAR(10))
INSERT INTO @t
SELECT 123,'blue','small'
UNION ALL SELECT 124,'black','medium'
UNION ALL SELECT 125,'red','large'
select * from @t
DECLARE @xml VARCHAR(max)
SELECT @xml = (
SELECT Part, Color, Size, '/' + cast(Part as varchar) AS PartC
FROM @t
FOR XML PATH(''), ROOT('PartsList') )
SELECT REPLACE(REPLACE(REPLACE(REPLACE( @xml,'</Part>','>'),'<Part>','<'),'</PartC>','>'),'<PartC>','<')
Please Note, you will not be able to load above text to DOM object for use as XML...