Writes the given XML document structure to the file given by filename.
If an error occurs while saving, the function returns -1 and sets errno.
| filename |
path to a file to save to |
| doc |
an XML document structure |
|
0 on success, -1 on failure |