docs: public static LooseConfig convertToLooseConfig(File looseFile) throws Exception {
          //make sure the file exists, can be read and is an xml
          if (looseFile.exists() && looseFile.isFile() && looseFile.canRead() && looseFile.getName().toLowerCase().endsWith(".xml")) {
              LooseConfig root = new LooseConfig(LooseType.ARCHIVE);
  
              XMLStreamReader reader = null;
              try {
                  LooseConfig cEntry = root;
  
                  Stack<LooseConfig> stack = new Stack<LooseConfig>();
  
                  stack.push(cEntry);
                  /*
                   * Normally we specifically request the system default XMLInputFactory to avoid issues when
                   * another XMLInputFactory is available on the thread context class loader. In this case it
                   * should be safe to use XMLInputFactory.newInstance() because the commands run separately
                   * from the rest of the code base.
                   */
                  reader = XMLInputFactory.newInstance().createXMLStreamReader(new FileInputStream(looseFile));
                  while (reader.hasNext() && cEntry != null) {
                      int result = reader.next();
                      if (result == XMLStreamConstants.START_ELEMENT) {
                          if ("archive".equals(reader.getLocalName())) {
                              String targetLocation = XMLUtils.getAttribute(reader, "targetInArchive");
                              if (targetLocation != null) {
                                  LooseConfig pEntry = cEntry;
  
                                  cEntry = new LooseConfig(LooseType.ARCHIVE);
                                  cEntry.targetInArchive = targetLocation;
  
                                  pEntry.children.add(cEntry);
                                  //put current Loose Entry into stack
                                  stack.push(cEntry);
                              }
                          } else if ("dir".equals(reader.getLocalName())) {
                              cEntry.children.add(createElement(reader, LooseType.DIR));
                          } else if ("file".equals(reader.getLocalName())) {
                              cEntry.children.add(createElement(reader, LooseType.FILE));
                          }
                      } else if (result == XMLStreamConstants.END_ELEMENT) {
                          if ("archive".equals(reader.getLocalName())) {
                              stack.pop();
                              //make sure stack isn't empty before we try and look at it
                              if (!stack.empty()) {
                                  //set current entry to be the top of stack
                                  cEntry = stack.peek();
                              } else {
                                  cEntry = null;
                              }
                          }
                      }
                  }
              } catch (FileNotFoundException e) {
                  throw e;
              } catch (XMLStreamException e) {
                  throw e;
              } catch (FactoryConfigurationError e) {
                  throw e;
              } finally {
                  if (reader != null) {
                      try {
                          reader.close();
                          reader = null;
                      } catch (XMLStreamException e) {
                          Debug.printStackTrace(e);
                      }
                  }
              }
              return root;
          }
  
          return null;
  
      }