SQL Server has a set of xquery functions (even though it is a rather limited subset of the W3C specifications) for querying, composing, and modifying XML data.
In the statement you posted, you are casting EmpDetails column (which probably is a character type) to an XML type, and then using the xquery function "query" to look for the xml node named "data(HR_Pay_class)".
There is a description of xquery functions in SQL Server here including some examples of the query function that is used in your example: http://msdn.microsoft.com/en-us/library/ms345122(v=sql.90).aspx