diff --git a/sorter/src/main/java/sortpom/output/XmlOutputGenerator.java b/sorter/src/main/java/sortpom/output/XmlOutputGenerator.java index cd0a7d75..03cbe239 100644 --- a/sorter/src/main/java/sortpom/output/XmlOutputGenerator.java +++ b/sorter/src/main/java/sortpom/output/XmlOutputGenerator.java @@ -110,11 +110,9 @@ private NamespaceStack findParentNamespaceStack() { @Override protected void writeEmptyElementClose(String qualifiedName) throws IOException { - if (!format.isExpandEmptyElements()) { - if (spaceBeforeCloseEmptyElement) { - // add an extra place before closing tag - writer.write(' '); - } + if (!format.isExpandEmptyElements() && spaceBeforeCloseEmptyElement) { + // add an extra place before closing tag + writer.write(' '); } super.writeEmptyElementClose(qualifiedName); }