for (Package pkg : packages.getPackage()) {
System.out.println(String.format("<package id=\"%s\" name=\"%s\">", pkg.getName(), pkg.getName()));
System.out.println(String.format("<footprint units=\"Millimeters\">"));
for (Object o : pkg.getPolygonOrWireOrTextOrDimensionOrCircleOrRectangleOrFrameOrHoleOrPadOrSmd()) {
if (o instanceof Smd) {
Smd smd = (Smd) o;
System.out.println(String.format("<pad x=\"%s\" y=\"%s\" width=\"%s\" height=\"%s\"/>", smd.getX(), smd.getY(), smd.getDx(), smd.getDy()));
}
}
System.out.println(String.format("</footprint>"));
System.out.println("</package>");
}