XMLPersistenceHelper.checkTag(element, GemPersistenceConstants.GEM_TAG);
// Add to the context, if an id attribute is present (otherwise, it's in the old save format..).
String gemId = element.getAttribute(GemPersistenceConstants.GEM_ID_ATTR);
if (gemId.equals("")) {
throw new BadXMLDocumentException(element, "Missing gem id.");
}
gemContext.addGem(this, gemId);
// Create inputs if any.
Element childNode = XMLPersistenceHelper.getChildElement(element, GemPersistenceConstants.INPUTS_TAG);