Extracting XML Attribute value

In the below xml code I need to extract only authentication-token, which is a attribute value.
I tried to use Execute XPath activity with “string(//tsResponse/credentials/@token)” but it is returning blank
I also tried XDOC.Element(“tsresponse”).Element(“credentials”).Attribute(“token”).Value
I also tried this XDOC.Element(“credentials”).Attribute(“token”).Value

But it doesnt work. Will someone help me with this?

code

@akshayajeyachandran
find a demo here:
XMLWithNameSpace_GetAttribute.xaml (5.0 KB)
working with following demo xml:
demoNamespaceGetAttribute.xml (166 Bytes)

have alook on how the namespace is defined and be used for the element / Attribute retrieval

I´d tryed to open your sample but get error. Do I need to install any special packages?
image

@Zlotzky
pease check if following package (same or higher version) is included via the dependency manager
grafik

sorry, but which package should I look for?

Hello,
In this video, I extract data from XML:

23:50 Deserialize XML
25:15 How to extract Data from XML Nodes
27:40 How to extract Data from XML Attributes

Thanks,
Cristian Negulescu