rewrite the given xmlfile

@param out the writer to write the xml
@param xmlFile xml file as a string
@param aloneTags a string array of empty tags
519045
public final void rewriteXml(
        Writer out,
        String xmlFile,
        String aloneTags[]
    ) {
        rewriteXml(
            out,
            xmlFile,
            aloneTags,
            false
        );
    }
95509
public void writeToFile(DescriptorRepository repository, ConnectionRepository conRepository, OutputStream out)
    {
        RepositoryTags tags = RepositoryTags.getInstance();
        try
        {
            if (log.isDebugEnabled())
                log.debug("## Write repository file ##" +
                        repository.toXML() +
                        "## End of repository file ##");


            String eol = SystemUtils.LINE_SEPARATOR;
            StringBuffer buf = new StringBuffer();
            // 1. write XML header
            buf.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + eol);

            buf.append("<!DOCTYPE descriptor-repository SYSTEM \"repository.dtd\" >" + eol + eol);
//            strReturn += "<!DOCTYPE descriptor-repository SYSTEM \"repository.dtd\" [" + eol;
//            strReturn += "<!ENTITY database-metadata SYSTEM \""+ConnectionRepository.DATABASE_METADATA_FILENAME+"\">" + eol;
//            strReturn += "<!ENTITY user SYSTEM \"repository_user.xml\">" + eol;
//            strReturn += "<!ENTITY junit SYSTEM \"repository_junit.xml\">" + eol;
//            strReturn += "<!ENTITY internal SYSTEM \"repository_internal.xml\"> ]>" + eol + eol;

            buf.append("<!-- OJB RepositoryPersistor generated this file on " + new Date().toString() + " -->" + eol);

            buf.append(tags.getOpeningTagNonClosingById(RepositoryElements.MAPPING_REPOSITORY) + eol);
            buf.append("  " + tags.getAttribute(RepositoryElements.REPOSITORY_VERSION, DescriptorRepository.getVersion()) + eol);
            buf.append("  " + tags.getAttribute(RepositoryElements.ISOLATION_LEVEL, repository.getIsolationLevelAsString()) + eol);
            buf.append(">" + eol);

            if(conRepository != null) buf.append(eol + eol + conRepository.toXML() + eol + eol);
            if(repository != null) buf.append(repository.toXML());

            buf.append(tags.getClosingTagById(RepositoryElements.MAPPING_REPOSITORY));

            PrintWriter pw = new PrintWriter(out);
            pw.print(buf.toString());
            pw.flush();
            pw.close();
        }
        catch (Exception e)
        {
            log.error("Could not write to output stream" + out, e);
        }
    }
109530
public static void writeXmlToUTF8(Element ele, Writer out) 
            throws IOException {
        XMLSerializer serializer =
                new XMLSerializer(out, XML_TO_UTF8);
        serializer.serialize(ele);
    }
1282769
public function saveXML(string $XMLfile): void
    {
        $file = new FileManager();
        $file->saveLittleFile($this->xmlData, $XMLfile);
    }
783757
public void writeXml(OutputStream out) throws IOException {
        Properties properties = getProps();
        try {
            Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
            Element conf = doc.createElement("configuration");
            doc.appendChild(conf);
            conf.appendChild(doc.createTextNode("\n"));
            for (Enumeration e = properties.keys(); e.hasMoreElements();) {
                String name = (String) e.nextElement();
                Object object = properties.get(name);
                String value;
                if (object instanceof String) {
                    value = (String) object;
                } else {
                    continue;
                }
                Element propNode = doc.createElement("property");
                conf.appendChild(propNode);

                Element nameNode = doc.createElement("name");
                nameNode.appendChild(doc.createTextNode(name));
                propNode.appendChild(nameNode);

                Element valueNode = doc.createElement("value");
                valueNode.appendChild(doc.createTextNode(value));
                propNode.appendChild(valueNode);

                conf.appendChild(doc.createTextNode("\n"));
            }

            DOMSource source = new DOMSource(doc);
            StreamResult result = new StreamResult(out);
            TransformerFactory transFactory = TransformerFactory.newInstance();
            Transformer transformer = transFactory.newTransformer();
            transformer.transform(source, result);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
830965
def write_xml_document(self, document):
        
        self._out.write(ET.tostring(document))
        self._out.flush()
1184940
public void writeXsd(File outFile) {

    File folder = outFile.getParentFile();
    if (!folder.isDirectory()) {
      boolean success = folder.mkdirs();
      if (!success) {
        throw new IllegalStateException("Failed to create folder " + folder);
      }
    }
    try (FileOutputStream fos = new FileOutputStream(outFile)) {
      writeXsd(fos);
    } catch (Exception e) {
      throw new IllegalStateException("Failed to generate and write the XSD schema to " + outFile + "!", e);
    }
  }
1013881
public static void writeXML(Document xmldocument, Writer writer) throws IOException {
		assert xmldocument != null : AssertMessages.notNullParameter(0);
		assert writer != null : AssertMessages.notNullParameter(1);
		writeNode(xmldocument, writer);
	}
753530
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    writer.newLine();
    writer.taggedValue("referencedMsg", msgId);
    writer.newLine();
    writer.taggedValue("AOTicks", tick+","+prevTick);
    writer.newLine();
    writer.taggedValue("gatheredMEUuid", sourceMEUuid);
  }
1202508
public static void writeXml(Serializable serializable, OutputStream output) throws IOException {
		TransportFormat.XML.writeSerializableTo(serializable, output);
	}
855588
public static void writeFileList(XMLOutput xmlOutput, String tagName, Iterator<File> listValueIterator) throws IOException {
        while (listValueIterator.hasNext()) {
            xmlOutput.openTag(tagName);
            xmlOutput.writeText(listValueIterator.next().getPath());
            xmlOutput.closeTag(tagName);
        }
    }
48694
public void printEndRecordGridData(PrintWriter out, int iPrintOptions)
    {
        out.println(Utility.endTag(XMLTags.FILE));
        out.println(Utility.endTag(XMLTags.DETAIL));
    }
1332542
public static void writeFile(CompoundTag tag, String path) throws IOException {
        writeFile(tag, new File(path));
    }
542966
public static void save(final AnnotationMappingInfo xmlInfo, final OutputStream out) throws XmlOperateException {
        ArgUtils.notNull(xmlInfo, "xmlInfo");
        ArgUtils.notNull(out, "out");
        
        try {
            JAXB.marshal(xmlInfo, out);
            
        } catch (DataBindingException e) {
            throw new XmlOperateException("fail save xml with JAXB.", e);
        }
        
    }
323720
public void write(Writer out)
         throws IOException
    {
        out.write('<'+tag+attributes()+'>');
        super.write(out);
        out.write("</"+tag+"\n>");
    }
1136165
@Override
    public final void xmlWriteRawOn(FormattedWriter writer, boolean callbackToItem) throws IOException
    {
        synchronized (_startLock)
        {
            if (_state == MessageStoreState.STATE_STARTED)
            {
                _xmlWriteRawOn(writer, callbackToItem);
            }
            else
            {
                writer.startTag(XML_MESSAGE_STORE);
                writer.indent();
                writer.newLine();
                writer.write(XML_CANNOT_BE_WRITTEN);
                writer.outdent();
                writer.newLine();
                writer.endTag(XML_MESSAGE_STORE);
            }
        }
    }
603157
public void xmlWriteOn(FormattedWriter writer) throws IOException
  {
    super.xmlWriteOn(writer);
    
    writer.newLine();
    writer.taggedValue("subscriberID", _subState.getSubscriberID());

    writer.newLine();
    writer.startTag("topics");
    writer.indent();

    String[] topics = _subState.getTopics();

    if (topics != null)
    {
      for (int i = 0; i < topics.length; i++)
      {
        writer.newLine();
        writer.taggedValue("topic", topics[i]);
      }
    }

    writer.outdent();
    writer.newLine();
    writer.endTag("topics");
    writer.newLine();
    writer.taggedValue("toBeDeleted", toBeDeleted);
  }