static void printXml(DexData dexData,boolean justClasses){
  ClassRef[] externClassRefs=dexData.getExternalReferences();
  String prevPackage=null;
  for (int i=0; i < externClassRefs.length; i++) {
    ClassRef cref=externClassRefs[i];
    String declClassName=cref.getName();
    String className=classNameOnly(declClassName);
    String packageName=packageNameOnly(declClassName);
    if (!packageName.equals(prevPackage)) {
      if (prevPackage != null) {
        out.println(IN1 + "</package>");
      }
      out.println(IN1 + "<package name=\"" + packageName+ "\">");
      prevPackage=packageName;
    }
    out.println(IN2 + "<class name=\"" + className+ "\">");
    if (!justClasses) {
      printXmlFields(cref);
      printXmlMethods(cref);
    }
    out.println(IN2 + "</class>");
  }
  if (prevPackage != null)   out.println(IN1 + "</package>");
}

static void printXml ( DexData dexData , boolean justClasses ) { ClassRef [ ] externClassRefs = dexData . getExternalReferences ( ) ; String prevPackage = null ; for ( int i = 0 ; i < externClassRefs . length ; i ++ ) { ClassRef cref = externClassRefs [ i ] ; String declClassName = cref . getName ( ) ; String className = classNameOnly ( declClassName ) ; String packageName = packageNameOnly ( declClassName ) ; if ( ! packageName . equals ( prevPackage ) ) { if ( prevPackage != null ) { out . println ( IN1 + "</package>" ) ; } out . println ( IN1 + "<package name=\"" + packageName + "\">" ) ; prevPackage = packageName ; } out . println ( IN2 + "<class name=\"" + className + "\">" ) ; if ( ! justClasses ) { printXmlFields ( cref ) ; printXmlMethods ( cref ) ; } out . println ( IN2 + "</class>" ) ; } if ( prevPackage != null ) out . println ( IN1 + "</package>" ) ; }
prints the output in xml format . we shouldn ' t need to xml - escape the field / method info .
