diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/XmlLayout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/XmlLayout.java
index 4364d9d..5b976b3 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/XmlLayout.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/XmlLayout.java
@@ -21,12 +21,16 @@ import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Map;
 
+import com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter;
 import org.apache.logging.log4j.core.Layout;
 import org.apache.logging.log4j.core.config.Node;
 import org.apache.logging.log4j.core.config.plugins.Plugin;
 import org.apache.logging.log4j.core.config.plugins.PluginAttribute;
 import org.apache.logging.log4j.core.config.plugins.PluginFactory;
 import org.apache.logging.log4j.core.jackson.XmlConstants;
+import org.codehaus.stax2.XMLStreamWriter2;
+
+import javax.xml.stream.XMLStreamException;
 
 // Lines too long...
 //CHECKSTYLE:OFF
@@ -195,7 +199,12 @@ public final class XmlLayout extends AbstractJacksonLayout {
     private static final String ROOT_TAG = "Events";
 
     protected XmlLayout(final boolean locationInfo, final boolean properties, final boolean complete, final boolean compact, final Charset charset) {
-        super(null, new JacksonFactory.XML().newWriter(locationInfo, properties, compact), charset, compact, complete, false, null, null);
+        super(null, new JacksonFactory.XML() {
+            @Override
+            protected EventXmlPrettyPrinter newPrettyPrinter() {
+                return new EventXmlPrettyPrinter();
+            }
+        }.newWriter(locationInfo, properties, compact), charset, compact, complete, false, null, null);
     }
 
     /**
@@ -295,4 +304,26 @@ public final class XmlLayout extends AbstractJacksonLayout {
     public static XmlLayout createDefaultLayout() {
         return new XmlLayout(false, false, false, false, StandardCharsets.UTF_8);
     }
+
+
+    /**
+     * When &lt;Event&gt;s are written into a XML file; the "Event" object is not the root element, but an element named &lt;Events&gt; created using {@link #getHeader()} and {@link #getFooter()} methods.<br/>
+     * {@link com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter} is used to print the Event object into XML; hence it assumes &lt;Event&gt; tag as the root element, so it prints the &lt;Event&gt; tag without any indentation.
+     * To add an indentation to the &lt;Event&gt; tag; hence an additional indentation for any sub-elements, this class is written. As an additional task, to avoid the blank line printed after the ending &lt;/Event&gt; tag, {@link #writePrologLinefeed(XMLStreamWriter2)} method is also overridden.
+     */
+    static class EventXmlPrettyPrinter extends DefaultXmlPrettyPrinter {
+
+        EventXmlPrettyPrinter() {
+            // set the nesting level to 1 rather than 0, so the "Event" tag will get indentation of next level below root.
+            _nesting = 1;
+        }
+
+        public void writePrologLinefeed(XMLStreamWriter2 sw) throws XMLStreamException {}
+
+        @Override
+        public DefaultXmlPrettyPrinter createInstance() {
+            return new EventXmlPrettyPrinter();
+        }
+
+    }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java
index 344b221..2b7fc92 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlCompleteFileAppenderTest.java
@@ -57,6 +57,7 @@ public class XmlCompleteFileAppenderTest {
         try (final BufferedReader reader = new BufferedReader(new FileReader(file))) {
             line1 = reader.readLine();
             line2 = reader.readLine();
+            reader.readLine(); // ignore the empty line after the <Events> root
             line3 = reader.readLine();
             line4 = reader.readLine();
         } finally {
@@ -81,4 +82,85 @@ public class XmlCompleteFileAppenderTest {
         final String location = "testFlushAtEndOfBatch";
         assertTrue("no location", !line1.contains(location));
     }
+
+    /**
+     * Test the indentation of the Events XML.
+     * <p>Expected Events XML is as below.</p>
+     * <pre>
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;Events xmlns=&quot;http://logging.apache.org/log4j/2.0/events&quot;&gt;
+
+  &lt;Event xmlns=&quot;http://logging.apache.org/log4j/2.0/events&quot; timeMillis=&quot;1460974522088&quot; thread=&quot;main&quot; level=&quot;INFO&quot; loggerName=&quot;com.foo.Bar&quot; endOfBatch=&quot;false&quot; loggerFqcn=&quot;org.apache.logging.log4j.spi.AbstractLogger&quot; threadId=&quot;11&quot; threadPriority=&quot;5&quot;&gt;
+    &lt;Message&gt;First Msg tag must be in level 2 after correct indentation&lt;/Message&gt;
+  &lt;/Event&gt;
+
+  &lt;Event xmlns=&quot;http://logging.apache.org/log4j/2.0/events&quot; timeMillis=&quot;1460974522089&quot; thread=&quot;main&quot; level=&quot;INFO&quot; loggerName=&quot;com.foo.Bar&quot; endOfBatch=&quot;true&quot; loggerFqcn=&quot;org.apache.logging.log4j.spi.AbstractLogger&quot; threadId=&quot;11&quot; threadPriority=&quot;5&quot;&gt;
+    &lt;Message&gt;Second Msg tag must also be in level 2 after correct indentation&lt;/Message&gt;
+  &lt;/Event&gt;
+&lt;/Events&gt;
+     * </pre>
+     * @throws Exception
+     */
+    @Test
+    public void testChildElementsAreCorrectlyIndented() throws Exception {
+        final File file = new File("target", "XmlCompleteFileAppenderTest.log");
+        file.delete();
+        final Logger log = LogManager.getLogger("com.foo.Bar");
+        final String firstLogMsg = "First Msg tag must be in level 2 after correct indentation";
+        log.info(firstLogMsg);
+        final String secondLogMsg = "Second Msg tag must also be in level 2 after correct indentation";
+        log.info(secondLogMsg);
+        CoreLoggerContexts.stopLoggerContext(false, file); // stop async thread
+
+        String[] lines = new String[9];
+
+        try (final BufferedReader reader = new BufferedReader(new FileReader(file))) {
+
+            int usefulLinesIndex = 0;
+            String readLine;
+            while((readLine = reader.readLine()) != null) {
+
+                if (!"".equals(readLine.trim())) {
+                    lines[usefulLinesIndex] = readLine;
+                    usefulLinesIndex++;
+                }
+            }
+        } finally {
+            file.delete();
+        }
+
+        String currentLine = lines[0];
+        assertFalse("line1 incorrect: [" + currentLine + "], must have no indentation", currentLine.startsWith(" "));
+        // <EVENTS
+        currentLine = lines[1];
+        assertFalse("line2 incorrect: [" + currentLine + "], must have no indentation", currentLine.startsWith(" "));
+        // <EVENT
+        currentLine = lines[2];
+        assertTrue("line3 incorrect: [" + currentLine + "], must have two-space indentation", currentLine.startsWith("  "));
+        assertFalse("line3 incorrect: [" + currentLine + "], must not have more than two-space indentation", currentLine.startsWith("   "));
+        // <MSG
+        currentLine = lines[3];
+        assertTrue("line4 incorrect: [" + currentLine + "], must have four-space indentation", currentLine.startsWith("    "));
+        assertFalse("line4 incorrect: [" + currentLine + "], must not have more than four-space indentation", currentLine.startsWith("     "));
+        // </EVENT
+        currentLine = lines[4];
+        assertTrue("line5 incorrect: [" + currentLine + "], must have two-space indentation", currentLine.startsWith("  "));
+        assertFalse("line5 incorrect: [" + currentLine + "], must not have more than two-space indentation", currentLine.startsWith("   "));
+
+        // <EVENT
+        currentLine = lines[5];
+        assertTrue("line6 incorrect: [" + currentLine + "], must have two-space indentation", currentLine.startsWith("  "));
+        assertFalse("line6 incorrect: [" + currentLine + "], must not have more than two-space indentation", currentLine.startsWith("   "));
+        // <MSG
+        currentLine = lines[6];
+        assertTrue("line7 incorrect: [" + currentLine + "], must have four-space indentation", currentLine.startsWith("    "));
+        assertFalse("line7 incorrect: [" + currentLine + "], must not have more than four-space indentation", currentLine.startsWith("     "));
+        // </EVENT
+        currentLine = lines[7];
+        assertTrue("line8 incorrect: [" + currentLine + "], must have two-space indentation", currentLine.startsWith("  "));
+        assertFalse("line8 incorrect: [" + currentLine + "], must not have more than two-space indentation", currentLine.startsWith("   "));
+        // </EVENTS
+        currentLine = lines[8];
+        assertFalse("line9 incorrect: [" + currentLine + "], must have no indentation", currentLine.startsWith(" "));
+    }
 }
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java
index b509b30..c3c04d8 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/appender/XmlFileAppenderTest.java
@@ -54,6 +54,7 @@ public class XmlFileAppenderTest {
         String line2;
         String line3;
         try (final BufferedReader reader = new BufferedReader(new FileReader(file))) {
+            reader.readLine(); // first line is empty, so ignore it
             line1 = reader.readLine();
             line2 = reader.readLine();
             line3 = reader.readLine();
