You can use Xelement, see example here:
Deep C# - XML in C#[
^]
You can save an Xelement like this:
XElement root = new XElement("Root",
new XElement("Child", "child content")
);
root.Save("Root.xml");
Note that things like
stid="-1" are called "attributes", see the example on how to create attributes for an Xelement.