Write the xml data into the file.

        Parameters
        ----------
        filename: Name of the file.

        Examples
        -------
        >>> writer = ProbModelXMLWriter(model)
        >>> writer.write_file(test_file)
428879
def write_file(self, filename):
        
        writer = self.__str__()[:-1].decode('utf-8')
        with open(filename, 'w') as fout:
            fout.write(writer)
466260
def write(self, filename):
        
        ext = os.path.splitext(filename)[1]
        writer = open(filename, 'w')
        if ext == '.py':
            writer.write(pprint.pformat(self))
        elif ext == '.yaml':
            writer.write(yaml.dump(self))
        else:
            writer.close()
            raise Exception('Unrecognized config format: %s'%ext)
        writer.close()
1187944
def saveFile(self, filename):
        
        ret = libxml2mod.xmlSaveFile(filename, self._o)
        return ret
618540
public void writeDocument(String filename, ProvFormat format, Document document) {
        Namespace.withThreadNamespace(document.getNamespace());
        try {
            logger.debug("writing " + format);
            logger.debug("writing " + filename);
            setNamespaces(document);
            switch (format) {
            case PROVN: {
                u.writeDocument(document, filename, pFactory);
                break;
            }
            case XML: {
                ProvSerialiser serial = ProvSerialiser
                        .getThreadProvSerialiser();
                logger.debug("namespaces " + document.getNamespace());
                serial.serialiseDocument(new File(filename), document, true);
                break;
            }
            case TURTLE: {
                new org.openprovenance.prov.rdf.Utility(pFactory, onto)
                        .dumpRDF(document, RDFFormat.TURTLE, filename);
                break;
            }
            case RDFXML: {
                new org.openprovenance.prov.rdf.Utility(pFactory, onto)
                        .dumpRDF(document, RDFFormat.RDFXML, filename);
                break;
            }
            case TRIG: {
                new org.openprovenance.prov.rdf.Utility(pFactory, onto)
                        .dumpRDF(document, RDFFormat.TRIG, filename);
                break;
            }
            case JSON: {
                new org.openprovenance.prov.json.Converter(pFactory)
                        .writeDocument(document, filename);
                break;
            }
            case DOT: {
                String configFile = null; // TODO: get it as option
                ProvToDot toDot = (configFile == null) ? new ProvToDot(
                        ProvToDot.Config.ROLE_NO_LABEL) : new ProvToDot(
                        configFile);
                toDot.setLayout(layout);
                toDot.convert(document, filename, title);
                break;
            }
            case PDF:
            case JPEG:
            case PNG:
            case SVG: {
                String configFile = null; // give it as option
                File tmp = File.createTempFile("viz-", ".dot");

                String dotFileOut = tmp.getAbsolutePath(); // give it as option,
                                                           // if not available
                                                           // create tmp file
                ProvToDot toDot;
                if (configFile != null) {
                    toDot = new ProvToDot(configFile);
                } else {
                    toDot = new ProvToDot(ProvToDot.Config.ROLE_NO_LABEL);
                }
                toDot.setLayout(layout);
                toDot.convert(document, dotFileOut, filename, extensionMap.get(format), title);
                tmp.delete();
                break;
            }

            default:
                break;
            }
        } catch (JAXBException e) {
            if (verbose != null)
                e.printStackTrace();
            throw new InteropException(e);

        } catch (IOException e) {
            if (verbose != null)
                e.printStackTrace();
            throw new InteropException(e);
        }

    }
1323403
def write_xml(self, xmlfile):
        """"""

        xmlfile = self.get_model_path(xmlfile)
        self.logger.info('Writing %s...', xmlfile)
        self.like.writeXml(str(xmlfile))
1045785
public static void writeToFile(String str, String fileName, Charset charset) throws Exception {
    OutputStreamWriter writer = null;
    if (null == charset) {
      writer = new OutputStreamWriter(new FileOutputStream(fileName));
    } else {
      writer = new OutputStreamWriter(new FileOutputStream(fileName), charset.name());
    }
    writer.write(str);
    writer.close();
  }
176275
def writefile(filename, content):
    
    with open(path_expand(filename), 'w') as outfile:
        outfile.write(content)
454661
def writeXML(self, e):
        
        self.writeType(TYPE_XML)

        data = xml.tostring(e)

        if isinstance(data, unicode):
            data = data.encode('utf-8')

        self.stream.write_ulong(len(data))
        self.stream.write(data)
448488
public void write(String filename)
	{
		try
		{
			write(new FileOutputStream(filename));
		}
		catch (FileNotFoundException e)
		{
			e.printStackTrace();
		}
	}
149375
@Override
    public void writeXML(String fileName) throws IOException {
        OutputStream out = new FileOutputStream(fileName);
        if (fileName.endsWith(".gz")) {
            out = new GZIPOutputStream(out);
        }
        writeXML(out);
    }
253760
def writetofile(self, filename):
        ''''''
        f = open(filename, "w")
        f.write(self.read())
        f.close()
210594
def writeprettyxml(self, filename_or_file=None, indent="  ", newl=os.linesep, 
                       encoding="UTF-8"):
        
        if not filename_or_file:
            filename_or_file = self.filename
        if isinstance(filename_or_file, (str, unicode)):
            filename_or_file = open(filename_or_file, "wb")
        xmlstr = self.toprettyxml(indent, newl, encoding)
        filename_or_file.write(xmlstr)
        filename_or_file.close()
279810
@Override
    public void writeXML(XMLOutput xmlOutput) throws IOException {
        xmlOutput.openTag(ELEMENT_NAME, new XMLAttributeList().addAttribute("class", className));
        for (Iterator<String> i = featureIterator(); i.hasNext();) {
            String feature = i.next();
            xmlOutput.openCloseTag(FEATURE_ELEMENT_NAME, new XMLAttributeList().addAttribute("value", feature));
        }
        xmlOutput.closeTag(ELEMENT_NAME);
    }
227041
public static void write(final String fileName, final BDD bdd) throws IOException {
    write(new File(fileName.endsWith(".dot") ? fileName : fileName + ".dot"), bdd);
  }
277356
def write(self, file_or_filename, prog=None, format='xdot'):
        
        if prog is None:
            file = super(DotWriter, self).write(file_or_filename)
        else:
            buf = StringIO.StringIO()
            super(DotWriter, self).write(buf)
            buf.seek(0)
            data = self.create(buf.getvalue(), prog, format)

            if isinstance(file_or_filename, basestring):
                file = None
                try:
                    file = open(file_or_filename, "wb")
                except:
                    logger.error("Error opening %s." % file_or_filename)
                finally:
                    if file is not None:
                        file.write(data)
                        file.close()
            else:
                file = file_or_filename
                file.write(data)

        return file
182858
def write(self, file_or_filename):
        
        self.book = Workbook()
        self._write_data(None)
        self.book.save(file_or_filename)
49476
public void xmlWriteOn(FormattedWriter writer) throws IOException {
        String name = "link";
        writer.write("<");
        writer.write(name);
        xmlWriteAttributesOn(writer);
        writer.write(" />");
    }