Please consider this XElement:
<MySerializeClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<F1>1</F1>
<F2>2</F2>
<F3>nima</F3>
</MySerializeClass>
I want to delete xmlns:xsi
and xmlns:xsd
from above XML.
I wrote this code but it does not work:
XAttribute attr = xml.Attribute("xmlns:xsi");
attr.Remove();
I got this error:
Additional information: The ':' character, hexadecimal value 0x3A, cannot be included in a name.
How I can delete above attributes?