The
toc:
prefix will be associated with an XML namespace URI - the
"Insert something" part of your
WriteStartElement
call. You need to pass the same URI to the
WriteAttributeString
method:
const string TocNamespaceUri = "...";
writer.WriteStartElement("toc", "file", TocNamespaceUri);
writer.WriteAttributeString("URI", TocNamespaceUri, "file:///filename.ice");
writer.WriteEndElement();
This will give you a node which looks like:
<toc:file toc:URI="file:///filename.ice" xmlns:toc="..." />
The namespace URI will need to be a specific value - you'll need to check the specification for the file to find out what that is.