title: XML Transform FileNotFoundException
body: <p>I'm creating a game using LibGDX and I want to create a XML file so I can save some configuration settings. </p>
  
  <p>I want the file to be inside the assets folder, inside another directory (assets/xml/ajustes.xml)</p>
  
  <p>If I execute the game as a Desktop Application it works OK, if the XML directory doesn't exist it is created and after that the XML file is created inside it. The problem comes when I execute the game in my Android device. I get an exception:</p>
  
  <pre><code>javax.xml.transform.TransformerException: java.io.FileNotFoundException: /xml/datos.xml (No such file or directory)
  </code></pre>
  
  <p>I cannot figure out where the problem is ... </p>
  
  <p>This is what I wrote:</p>
  
  <pre><code>public static final String localizacionXML = "xml/datos.xml";
  
  ...
  
  try {
  
          //THE xml DIRECTORY SHOULD BE CREATED HERE
          File dir = new File("xml");
          dir.mkdirs();
  
          File f = new File(localizacionXML);
  
          DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
          DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
  
          //IF XML ALREADY EXISTS
          if(f.exists() &amp;&amp; !f.isDirectory()) {
              ...
          }else{
              DocumentBuilderFactory docFactory = 
              DocumentBuilderFactory.newInstance();
              DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
  
              Document doc = docBuilder.newDocument();
  
              ...
  
              TransformerFactory transformerFactory = 
              TransformerFactory.newInstance();
              Transformer transformer = transformerFactory.newTransformer();
              DOMSource source = new DOMSource(doc);
              StreamResult result = new StreamResult(new 
                  File(localizacionXML).getAbsolutePath());
  
              //EXCEPTION HERE
              transformer.transform(source, result);
          }
  }catch (Exception e){
      e.printStackTrace();
  }
  </code></pre>