code: private void addFileElements(Collection<ArchiveEntry> files, Element filesElement) throws Exception
      {
          for (ArchiveEntry entry : files) {
              // Don't add files in META-INF to the package.xml file
              if (entry.getName().indexOf("META-INF") == -1) {
                  XWikiDocument xdoc = getDocFromXML(entry.getFile());
                  String reference = xdoc.getReference();
                  Element element = new DOMElement(FILE_TAG);
                  element.setText(reference);
                  element.addAttribute("language", xdoc.getLocale());
                  element.addAttribute("defaultAction", "0");
  
                  // Add configured properties
                  XAREntry cfgEntry = getEntryMap().get(reference);
                  if (cfgEntry != null && cfgEntry.getType() != null) {
                      element.addAttribute("type", cfgEntry.getType());
                  }
  
                  filesElement.add(element);
              }
          }
      }
docs: Add all the XML elements under the &lt;files&gt; element (the list of files present in the XAR).
  
  @param files the list of files that we want to include in the generated package XML file.
  @param filesElement the files element to which to add to