I could not get the value using the XQUERY but instead first, I got the value of column 'DATA' as String and then used the following method (which uses Xpath) to get the value of the node 'Name'.
public String getEmpNameFromEmployee(String employeeXml)
throws SAXException, IOException, XPathExpressionException {
DocumentBuilderFactory builderFactory = DocumentBuilderFactory
.newInstance();
DocumentBuilder builder = null;
try {
builder = builderFactory.newDocumentBuilder();
} catch (ParserConfigurationException e) {
e.printStackTrace();
}
Document xmlDocument = builder.parse(new ByteArrayInputStream(employeeXml
.getBytes()));
XPath xPath = (XPath) XPathFactory.newInstance().newXPath();
String expression = "/Employee/EmpDetails/Name";
String empName = xPath.compile(expression).evaluate(
xmlDocument);
return empName;