The signature is a method on the Document interface, but it doesn't actually affect/use that file. Current usage:
doc.WriteToFile(path, content)
The usage would make more sense to me as one of the following:
doc.WriteToFile(content)
// or
WriteToFile(path, content)