if (nodes.getLength() > 0) {
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
// Build an xml entity listener.
XMLEntityListener listener = new XMLEntityListener(m_helper.getClassForNode(node), entityClass);
// Process the lifecycle callback events from XML.
Method[] candidateMethods = MetadataHelper.getCandidateCallbackMethodsForEntityListener(listener);
processLifecycleEvents(listener, node, m_helper, candidateMethods);