We are using Xmlwriter object to create xml and using below code to write an attribute:
xmlWriter.WriteAttributeString("UIVersion", GetWorkflowAssociationUIVersion(wfa, xmlWriter));
Now after this we execute some lines of code and based on some conditional code our requirement is to change the value of attribute "UIVersion" again. now we cannot use xmlWriter.WriteAttributeString("UIVersion", foldername) as it will create a new attribute. Any inputs on how can we update the attribute
XmlWriterRepresents a writer that provides a fast, non-cached, forward-only way to generate streams or files that contain XML data. Since it's forward-only you can't rewind and rewrite the attribute you previously wrote. Instead, use one of XML editing APIs suggested in the answer linked by @dnickless. Or, just don't write the attribute until you know what you want to write.