title: JDOM2- Don't auto close tags
body: <p>I am generating a XML file using JDOM . Since I didn't put any content in a element , it auto closes . This is not the behavior I want , because the user is supposed to fill the file. Is it possible to make the element not auto close itself?</p>
  <h2>Generating file</h2>
  <pre><code> public void generateMigrationFile(String fileName) throws IOException {
          Document migrationDocument=new Document();
  
          Namespace namespace = Namespace.getNamespace(&quot;http://www.liquibase.org/xml/ns/dbchangelog&quot;);
          Element databaseChangelogElement = new Element(&quot;databaseChangeLog&quot;, namespace);
          Namespace XSI = Namespace.getNamespace(&quot;xsi&quot;, &quot;http://www.w3.org/2001/XMLSchema-instance&quot;);
          databaseChangelogElement.addNamespaceDeclaration(XSI);
          databaseChangelogElement.setAttribute(&quot;schemaLocation&quot;, &quot;http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd&quot;, XSI);
  
          Element changeSetElement=new Element(&quot;changeSet&quot;,namespace);
          changeSetElement.setAttribute(&quot;author&quot;,&quot;&quot;);
          changeSetElement.setAttribute(&quot;id&quot;,UUID.randomUUID().toString());
          databaseChangelogElement.addContent(changeSetElement);
  
          migrationDocument.setRootElement(databaseChangelogElement);
  
          XMLOutputter outter=new XMLOutputter();
          outter.setFormat(Format.getPrettyFormat());
          outter.output(migrationDocument, new FileWriter(new File(&quot;migration_files\\&quot;+fileName+&quot;.xml&quot;)));
          //outter.output(migrationDocument, new FileWriter(new File(&quot;C:\\Users\\fabio\\Desktop\\Migrations\\migration_files\\&quot;+fileName+&quot;.xml&quot;)));
  
          System.out.println(&quot;Migration file generated successfully&quot;);
      }
  </code></pre>
  <h2>Generated file</h2>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;databaseChangeLog xmlns=&quot;http://www.liquibase.org/xml/ns/dbchangelog&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd&quot;&gt;
    &lt;changeSet author=&quot;&quot; id=&quot;5d4dbc70-39f4-4079-9fc0-7cac291f1c04&quot; /&gt;
  &lt;/databaseChangeLog&gt;
  </code></pre>
  <h2>Expected generated file</h2>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;databaseChangeLog xmlns=&quot;http://www.liquibase.org/xml/ns/dbchangelog&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd&quot;&gt;
    &lt;changeSet author=&quot;&quot; id=&quot;5d4dbc70-39f4-4079-9fc0-7cac291f1c04&quot;&gt;
    &lt;/changeSet&gt; 
  &lt;/databaseChangeLog&gt;
  </code></pre>