0

I have an XML file that I would like to delete the empty tag <eCode /> from it and then save the XML file.

I have tried deleting it using xdocument but I wasn't able to identify the empty tag. Thanks in advance.



<?xml version="1.0" encoding-"utf-8" 2>

<fa xmlns="http://bmw.com/2005/psdz.data.fa

<header vinlong="SUXTR9G50KLR07426" date-"2023-04-17" time-"00:15:34.0000000+03:00" createdBy=

<standardF A series="G00 1" typekey-"TR93" timecriteria-"03 19" colourcode="0475" fabricCode="MAPQ"

faVersion="3">

<ecodes>

<eCode>A105</eCode>

<ecode>HUTR</eCode>

<eCode />

</ecodes>

</standardF A>

</fa>


Andrew Morton
  • 24,203
  • 9
  • 60
  • 84
  • That isn't valid XML. – Andrew Morton Apr 22 '23 at 14:45
  • Your "XML" is not well-formed. You cannot use an XML library to process data that's not XML. Fix the XML first, then retry your vb.net code. If you still have trouble, post your fixed XML and your vb.net code (a [mcve]) to request further help. – kjhughes Apr 22 '23 at 14:53
  • If you actually have valid XML but something went wrong showing it in the question, then please see [Remove empty/blanks elements in collection of XML nodes](https://stackoverflow.com/questions/14509188/remove-empty-blanks-elements-in-collection-of-xml-nodes). – Andrew Morton Apr 23 '23 at 11:00

0 Answers0