Hi Rajus,
Please refer below sample.
TextFile
<TA>
<Response>
<User_Id>CGG</User_Id>
<Aadhar_Id>121212121212</Aadhar_Id>
<OTP info="01{A,2021-11-30T17:50:34,2.5,d320b4ab5e07ae4b14742670399e4fc744b1522306197afd2ba3d3ada498e39d,2e5b42bbb406322a1c38d2d345c9c0ff06437ade9756db39ff29131181b3b13b,2e5b42bbb406322a1c38d2d345c9c0ff06437ade9756db39ff29131181b3b13b,NA,NA}"
status="998" Description="Invalid Aadhaar Number." Code="30f1de0363614c6395e735a068b13cef" RRN="133417175257" txn="000113000020211130175034891133417175257" />
</Response>
</TA>
HTML
User Id: <asp:Label ID="lblUserId" runat="server" /><br />
Aadhar Id: <asp:Label ID="lblAadhar" runat="server" /><br />
OTP: <asp:Label ID="lblOTP" runat="server" />
Namespace
C#
using System.Data;
using System.IO;
using System.Xml;
VB.Net
Imports System.Data
Imports System.IO
Imports System.Xml
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string xml = File.ReadAllText(Server.MapPath("~/Xml.txt"));
XmlDocument doc = new XmlDocument();
doc.LoadXml(xml);
XmlNodeList nodeList = doc.SelectNodes("/TA/Response");
lblUserId.Text = nodeList[0]["User_Id"].InnerText;
lblAadhar.Text = nodeList[0]["Aadhar_Id"].InnerText;
lblOTP.Text = (nodeList[0]["OTP"].Attributes)["RRN"].InnerText;
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim xml As String = File.ReadAllText(Server.MapPath("~/Xml.txt"))
Dim doc As XmlDocument = New XmlDocument()
doc.LoadXml(xml)
Dim nodeList As XmlNodeList = doc.SelectNodes("/TA/Response")
lblUserId.Text = nodeList(0)("User_Id").InnerText
lblAadhar.Text = nodeList(0)("Aadhar_Id").InnerText
lblOTP.Text = (nodeList(0)("OTP").Attributes)("RRN").InnerText
End Sub
Screenshot