Write the xml data into the file.

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

        Examples
        -------
        >>> writer = XMLBIFWriter(model)
        >>> writer.write_xmlbif(test_file)
549146
def write_xmlbif(self, filename):
        
        with open(filename, 'w') as fout:
            fout.write(self.__str__())
569392
def _write_file(self, filename, data):
        

        if self.__compression:
            f = gzip.GzipFile(filename, "wb")
        else:
            f = open(filename, "wb")
        pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)
        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()
719603
def write(self, endpoints, filename):
        # type: (List[EndpointDescription], str) -> None
        
        with open(filename, "w") as filep:
            filep.write(self.to_string(endpoints))
521292
def writeXML(self, n):
        
        self.stream.write(TYPE_XMLSTRING)
        ref = self.context.getObjectReference(n)

        if ref != -1:
            self._writeInteger(ref << 1)

            return

        self.context.addObject(n)

        self.serialiseString(xml.tostring(n).encode('utf-8'))
924066
def writexml(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.toxml(indent, newl, encoding)
        filename_or_file.write(xmlstr)
        filename_or_file.close()
873550
public void write(XMLStreamWriter writer, AttributeDefinition<?> def) throws XMLStreamException {
      write(writer, def, def.xmlName());
   }
648760
def _write_rough_result_xml_to_file(self, xml, filename):
        """"""
        # Write content to temp file first
        error = xml.get('error', None)
        xml.set('error', 'incomplete') # Mark result file as incomplete
        temp_filename = filename + ".tmp"
        with open(temp_filename, 'wb') as file:
            ET.ElementTree(xml).write(file, encoding='utf-8', xml_declaration=True)
        os.rename(temp_filename, filename)
        if error is not None:
            xml.set('error', error)
        else:
            del xml.attrib['error']
399673
def _write_xml(xmlfile, srcs):
        
        root = ElementTree.Element('source_library')
        root.set('title', 'source_library')

        for src in srcs:
            src.write_xml(root)

        output_file = open(xmlfile, 'w')
        output_file.write(utils.prettify_xml(root))
205249
public void write() throws IOException {
        OutputStream outStream = null;
        XMLStreamWriter out = null;
        try {
            outStream = new FileOutputStream(jobFile);
            out = XMLOutputFactory.newInstance().createXMLStreamWriter(outStream, "UTF-8");
            out.writeStartDocument();
            out.writeStartElement(ELEMENT_JOB);
            for (final Map.Entry<String, Object> e: prop.entrySet()) {
                out.writeStartElement(ELEMENT_PROPERTY);
                out.writeAttribute(ATTRIBUTE_NAME, e.getKey());
                if (e.getValue() instanceof String) {
                    out.writeStartElement(ELEMENT_STRING);
                    out.writeCharacters(e.getValue().toString());
                    out.writeEndElement(); //string
                } else if (e.getValue() instanceof Set) {
                    out.writeStartElement(ELEMENT_SET);
                    final Set<?> s = (Set<?>) e.getValue();
                    for (final Object o: s) {
                        out.writeStartElement(ELEMENT_STRING);
                        out.writeCharacters(o.toString());
                        out.writeEndElement(); //string
                    }
                    out.writeEndElement(); //set
                } else if (e.getValue() instanceof Map) {
                    out.writeStartElement(ELEMENT_MAP);
                    final Map<?, ?> s = (Map<?, ?>) e.getValue();
                    for (final Map.Entry<?, ?> o: s.entrySet()) {
                        out.writeStartElement(ELEMENT_ENTRY);
                        out.writeAttribute(ATTRIBUTE_KEY, o.getKey().toString());
                        out.writeStartElement(ELEMENT_STRING);
                        out.writeCharacters(o.getValue().toString());
                        out.writeEndElement(); //string
                        out.writeEndElement(); //entry
                    }
                    out.writeEndElement(); //string
                } else {
                    out.writeStartElement(e.getValue().getClass().getName());
                    out.writeCharacters(e.getValue().toString());
                    out.writeEndElement(); //string
                }
                out.writeEndElement(); //property
            }
            out.writeStartElement(ELEMENT_FILES);
            for (final FileInfo i: files.values()) {
                out.writeStartElement(ELEMENT_FILE);
                if (i.src != null) {
                    out.writeAttribute(ATTRIBUTE_SRC, i.src.toString());
                }
                out.writeAttribute(ATTRIBUTE_URI, i.uri.toString());
                out.writeAttribute(ATTRIBUTE_PATH, i.file.getPath());
                if (i.result != null) {
                    out.writeAttribute(ATTRIBUTE_RESULT, i.result.toString());
                }
                if (i.format != null) {
                    out.writeAttribute(ATTRIBUTE_FORMAT, i.format);
                }
                try {
                    for (Map.Entry<String, Field> e: attrToFieldMap.entrySet()) {
                        final boolean v = e.getValue().getBoolean(i);
                        if (v) {
                            out.writeAttribute(e.getKey(), Boolean.TRUE.toString());
                        }
                    }
                } catch (final IllegalAccessException ex) {
                    throw new RuntimeException(ex);
                }
                out.writeEndElement(); //file
            }
            out.writeEndElement(); //files
            out.writeEndElement(); //job
            out.writeEndDocument();
        } catch (final IOException e) {
            throw new IOException("Failed to write file: " + e.getMessage());
        } catch (final XMLStreamException e) {
            throw new IOException("Failed to serialize job file: " + e.getMessage());
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (final XMLStreamException e) {
                    throw new IOException("Failed to close file: " + e.getMessage());
                }
            }
            if (outStream != null) {
                try {
                    outStream.close();
                } catch (final IOException e) {
                    throw new IOException("Failed to close file: " + e.getMessage());
                }
            }
        }
        lastModified = jobFile.lastModified();
    }
1284573
def writeFile(filename, data):
		
		with open(filename, 'wb') as f:
			f.write(data.encode('utf-8'))
415672
private void writeFileArgument(String key, File file, XMLEventWriter writer)
            throws XMLStreamException, JournalException {
        try {
            putStartTag(writer, QNAME_TAG_ARGUMENT);
            putAttribute(writer, QNAME_ATTR_NAME, key);
            putAttribute(writer, QNAME_ATTR_TYPE, ARGUMENT_TYPE_STREAM);

            EncodingBase64InputStream encoder =
                    new EncodingBase64InputStream(new BufferedInputStream(new FileInputStream(file)));
            String encodedChunk;
            while (null != (encodedChunk = encoder.read(1000))) {
                putCharacters(writer, encodedChunk);
            }
            encoder.close();
            putEndTag(writer, QNAME_TAG_ARGUMENT);
        } catch (IOException e) {
            throw new JournalException("IO Exception on temp file", e);
        }
    }
744879
def write(self, fileobj = sys.stdout, xsl_file = None):
		
		fileobj.write(Header)
		fileobj.write(u"\n")
		if xsl_file is not None:
			fileobj.write(u'<?xml-stylesheet type="text/xsl" href="%s" ?>\n' % xsl_file)
		for c in self.childNodes:
			if c.tagName not in self.validchildren:
				raise ElementError("invalid child %s for %s" % (c.tagName, self.tagName))
			c.write(fileobj)
614931
def write(self, file_or_filename):
        
        if isinstance(file_or_filename, basestring):
            self._fcn_name, _ = splitext(basename(file_or_filename))
        else:
            self._fcn_name = self.case.name

        self._fcn_name = self._fcn_name.replace(",", "").replace(" ", "_")

        super(MATPOWERWriter, self).write(file_or_filename)
809663
public void write(XMLStreamWriter writer) throws XMLStreamException {
      for (Attribute<?> attr : attributes.values()) {
         if (attr.isPersistent())
            attr.write(writer, attr.getAttributeDefinition().xmlName());
      }
   }
1023448
public void write(Writer writer, String enclosingNamespace) throws IOException {
        for (CharSequence csq : sb.getAsList()) {
            if (csq instanceof XmlStringBuilder) {
                ((XmlStringBuilder) csq).write(writer, enclosingNamespace);
            }
            else if (csq instanceof XmlNsAttribute) {
                XmlNsAttribute xmlNsAttribute = (XmlNsAttribute) csq;
                if (!xmlNsAttribute.value.equals(enclosingNamespace)) {
                    writer.write(xmlNsAttribute.toString());
                    enclosingNamespace = xmlNsAttribute.value;
                }
            }
            else {
                writer.write(csq.toString());
            }
        }
    }
965610
@Override
    public void xmlWriteOn(FormattedWriter writer) throws IOException
    {
        super.xmlWriteOn(writer);
        writer.newLine();
        writer.taggedValue("toBeDeleted", _toBeDeleted);
        writer.newLine();
        writer.taggedValue("toBeIgnored", _toBeIgnored);
    }