diff --git a/Changelog.md b/Changelog.md
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,3 +1,7 @@
+# 1.0.3
+
+* Now creates the directory containing the report XML file. Thanks to @haishengwu-okta for this feature.
+
 # 1.0.2
 
 * Build with tasty < 0.12.
diff --git a/Test/Tasty/Runners/AntXML.hs b/Test/Tasty/Runners/AntXML.hs
--- a/Test/Tasty/Runners/AntXML.hs
+++ b/Test/Tasty/Runners/AntXML.hs
@@ -20,6 +20,8 @@
 import Data.Typeable (Typeable)
 import GHC.Generics (Generic)
 import Generics.Deriving.Monoid (memptydefault, mappenddefault)
+import System.Directory (createDirectoryIfMissing, canonicalizePath)
+import System.FilePath (takeDirectory)
 
 import qualified Control.Concurrent.STM as STM
 import qualified Control.Monad.State as State
@@ -136,7 +138,7 @@
              testTree
 
         return $ \elapsedTime -> do
-
+          createPathDirIfMissing path
           writeFile path $
             XML.showTopElement $
               appEndo (xmlRenderer summary) $
@@ -164,3 +166,6 @@
     case Tasty.resultOutcome r of
          Tasty.Failure (Tasty.TestTimedOut _) -> True
          _ -> False
+
+  createPathDirIfMissing path = fmap takeDirectory (canonicalizePath path)
+                                >>= createDirectoryIfMissing True
diff --git a/tasty-ant-xml.cabal b/tasty-ant-xml.cabal
--- a/tasty-ant-xml.cabal
+++ b/tasty-ant-xml.cabal
@@ -1,5 +1,5 @@
 name: tasty-ant-xml
-version: 1.0.2
+version: 1.0.3
 synopsis: Render tasty output to XML for Jenkins
 description: A tasty ingredient to output test results in XML, using the Ant schema. This XML can be consumed by the Jenkins continuous integration framework.
 homepage: http://github.com/ocharles/tasty-ant-xml
@@ -25,6 +25,8 @@
     tagged >= 0.7,
     tasty >= 0.10 && < 0.12,
     transformers >= 0.3.0.0,
+    directory >= 1.2.6.2,
+    filepath >= 1.4.1.0,
     xml >= 1.3.13
   default-language: Haskell98
   ghc-options: -Wall -O2
