0

I have a following XML file to parse:

<result>
<iban>GB20ULSB98006054100029</iban>
<account>54100029</account>
<sort_code>980060</sort_code>
<bank>ULSTER BANK LTD</bank>
<branch>BELFAST CITY OFFICE 1</branch>
<bic>ULSBGB2BXXX</bic>
<address>PO BOX 232 11-16 DONEGALL SQUARE EAST </address>
<city>BT1 5UB</city>
<country>GB<country/>
<phone>028 90244112</phone>
</result>

Can anyone please tell me how to get an element 'iban'?

95XF
  • 37
  • 8

1 Answers1

1

Using XDocument, you can read the elements

var xdoc = XDocument.Load("XMLFile1.xml");
var iban = xdoc.Element("result").Element("iban").Value;
Rand Random
  • 7,300
  • 10
  • 40
  • 88
Krishna Varma
  • 4,238
  • 2
  • 10
  • 25