Node gceNode = null;
for (int i = 0, len = nodeList.getLength(); i < len; i++) {
Node curNode = nodeList.item(i);
if (curNode.getNodeName().equals(gceNodeName)) {gceNode = curNode; break;}
}
if (gceNode == null) throw new IIOInvalidTreeException("Invalid image metadata, could not find " + gceNodeName + "node.", null, tree);
Node delayNode = gceNode.getAttributes().getNamedItem(delayNodeName);
if (delayNode == null) {
delayNode = tree.getOwnerDocument().createAttribute(delayNodeName);
gceNode.appendChild(delayNode);
}