• I have to agree with Steve, I'm not a fan of XQuery. I (normally) have to look up the syntax each and every time I have to use it.

    To the OP, this might get you on the right path.  I'm not quite sure what you want as your WHERE, but the syntax to get you on track is there:

    CREATE TABLE #XML (XMLData xml);
    INSERT INTO #XML
    VALUES (
    '<SelectedValues>
    <SelectedValue>
      <Name>UPC</Name>
      <Value>Test10</Value>
    </SelectedValue>
    <SelectedValue>
      <Name>Brand</Name>
      <Value>HP</Value>
    </SelectedValue>
    <SelectedValue>
      <Name>UPC</Name>
      <Value>Test11</Value>
    </SelectedValue>
    </SelectedValues>'
    )
    GO
    SELECT SV.S.value('(Value/text())[1]','varchar(10)') AS TextValue
    FROM #XML X
      CROSS APPLY X.XMLData.nodes('/SelectedValues/SelectedValue') SV (s)
    WHERE SV.S.value('(Name/text())[1]','varchar(10)') = 'UPC';
    GO
    DROP TABLE #XML;

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk