Selecting Record from XML Valued Column in MS SQL

Just Consider we have following records in a object named CR_NonDPC_ConfigDTO

PCName : PC
MotherBoard : ASROK 945 GCM
Processor : Pantium
HDD : HDD 160 GB
RAM : DDR-2 1 GB
Cassing : NULL
ExtraConfig : CD ROM ASUS

Now we shall convert it to XML (for converting Object to XML you can check here)
Here is the xml of above object


  PC
  ASROK 945 GCM
  Pantium 4 2.8 GHz
  HDD 160 GB
  DDR-2 1 GB
  
  CD ROM ASUS


Now consider this xml is stored in a table named “ComplainSUb” and column “PCConfig”.
Now we shall select record from xml valued column using MS SQL

SELECT
 PCConfig.value('(/CR_NonDPC_ConfigDTO//MotherBoard/node())[1]', 'varchar(max)') as MotherBoard
,PCConfig.value('(/CR_NonDPC_ConfigDTO//Processor/node())[1]', 'varchar(max)') as Processor
,PCConfig.value('(/CR_NonDPC_ConfigDTO//HDD/node())[1]', 'varchar(max)') as HDD
,PCConfig.value('(/CR_NonDPC_ConfigDTO//RAM/node())[1]', 'varchar(max)') as RAM
,PCConfig.value('(/CR_NonDPC_ConfigDTO//Cassing/node())[1]', 'varchar(max)') as Casing
,PCConfig.value('(/CR_NonDPC_ConfigDTO//ExtraConfig/node())[1]', 'varchar(max)') as ExtraConfig
From
SER_ComplainSUb --'where condition goes here' 

--SER_ComplainSUb = Table Name
--PCConfig = Column Name
--CR_NonDPC_ConfigDTO = Object Name
--/CR_NonDPC_ConfigDTO//Property Name