I am writing a C# utility to generate a large XML SOAP request to send a list of products and their attributes to a third party application, which expects the XML in a specific way. Each product has about 30 XML tags. It is not possible to change the XML schema, or convert to JSON.
I am processing around 3000 products, which is roughly taking 25 seconds on my test machine. The products will increase manifold times in future.
Is there a way to speed up the XML generation process? I am primarily using XmlDocument's CreateElement and CreateAttribute (for nodes with attributes), inside a loop, and then covert the final document to string to send as an HTTP request to a locally deployed third party app.
Thanks.