public Actor CreateActorFromElement(XmlReader.Element e) { String name = e.getName(); Actor a = null; for (String namespaceName : importedNamespaceNames) { Namespace importedNamespace = rootNamespace.namespace(namespaceName); if (!importedNamespace.isElementListEmpty()) { ArrayList<ElementDirective> DirectiveElements = importedNamespace.getElements(); for (ElementDirective d : DirectiveElements) { if (name.equalsIgnoreCase(d.getName())) { a = d.processDirective(null, e); if (a != null) { if (d.isApplyCommonAttribute()) { if (!importedNamespace.isAttributeListEmpty()) { ArrayList<AttributeDirective> CommonAttributes = importedNamespace.getAttributes(); for (AttributeDirective ad : CommonAttributes) { a = ad.processDirective(a, e); } } } } return a; } } } } return a; }