0

I am using

new XElement("InstdAmt", "1000")

However, I would like to add the currency in the first tag as shown below. How could I do this please?

Only using the first tag

new XElement("InstdAmt Ccy=EUR", "1000")

so I can get this result

<InstdAmt Ccy="EUR">1000</InstdAmt>
alex
  • 5,516
  • 2
  • 36
  • 60
user3274252
  • 57
  • 1
  • 6

1 Answers1

1

Just add an attribute:

 new XElement("InstdAmt", new XAttribute("Ccy", "Eur"), "1000");
H H
  • 263,252
  • 30
  • 330
  • 514