• Something like this (assuming you're using SS2K5 or above)?

    DECLARE @xml XML

    SELECT @xml='<Root>

    <Data>

    <Item ID="1" AdditionalInfo="Some info">

    <SubItem ID="1">1</SubItem>

    <SubItem ID="2">2</SubItem>

    <SubItem ID="3">3</SubItem>

    </Item>

    <Item ID="2" AdditionalInfo="Some info">

    <SubItem ID="1">1</SubItem>

    <SubItem ID="2">2</SubItem>

    </Item>

    </Data>

    </Root>'

    SELECT

    y.value('@ID[1]','INT') AS SubItemId,

    y.value('.','INT') AS SubItemValue,

    c.value('@ID[1]','INT') AS ItemId,

    c.value('@AdditionalInfo[1]','varchar(30)') AS AdditionalInfo

    FROM @xml.nodes('Root/Data/Item') T(c)

    CROSS APPLY

    c.nodes('SubItem') X(y)



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]