class ImageSizeHandler {

    public static ImageSize[] extractImageSizes(Document manifestDocument) {
        final NodeList nadirElements = manifestDocument.getElementsByTagName("slstr:nadirImageSize");
        final NodeList obliqueElements = manifestDocument.getElementsByTagName("slstr:obliqueImageSize");
        final ImageSize[] imageSizes = new ImageSize[nadirElements.getLength() + obliqueElements.getLength()];
        for (int i = 0; i < nadirElements.getLength(); i++) {
            imageSizes[i] = extractImageSizeFromNode(nadirElements.item(i), "n");
        }
        for (int i = 0; i < obliqueElements.getLength(); i++) {
            imageSizes[nadirElements.getLength() + i] = extractImageSizeFromNode(obliqueElements.item(i), "o");
        }
        return imageSizes;
    }

}