I am trying to extract the xml values in java
Below is the xml and I want to extract userUuid from the xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ResponseSet vers="1.0" svcid="session" reqid="3">
<Response><![CDATA[
<SessionResponse vers="1.0" reqid="0">
<GetSession>
<Session sid="******" stype="user" cid="uid=****" cdomain="o=nhs" maxtime="0" maxidle="0" maxcaching="0" timeidle="0" timeleft="****" state="valid">
<Property name="userUuid" value="555524799109"></Property>
</Session>
</GetSession>
</SessionResponse>]]>
</Response>
</ResponseSet>
I referred this links none of them worked from me
Read XML in Java with XML attributes
How can I read Xml attributes using Java?
Also I tried
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
dbFactory.setNamespaceAware(true);
dbFactory.setValidating(false);
DocumentBuilder docBuilder = dbFactory.newDocumentBuilder();
ByteArrayInputStream inputStream = new ByteArrayInputStream(sXMLData.getBytes("UTF-8"));
Document document = docBuilder.parse(inputStream);
NodeList nodeList = document.getElementsByTagName("Property");
System.out.println(nodeList.getLength());
for (int i = 0; i < nodeList.getLength(); i++) {
Element element = (Element) nodeList.item(i);
String el = element.getAttribute("name");
System.out.println(el);
}