protected Object[] getXSDSchemaChildren(XSDSchema schema) { List<XSDElementDeclaration> declarations = new ArrayList<XSDElementDeclaration>(); List<Object> attributeDeclarations = new ArrayList<Object>(); if (null != xsdSchema) { for (XSDSchemaContent cnt : xsdSchema.getContents()) { if (cnt instanceof XSDInclude) { XSDInclude incu = (XSDInclude) cnt; String schemaLocation = incu.getSchemaLocation(); XSDSchema schemaInc = createSchema(schemaLocation); addElementDeclarationFromSchema(schemaInc, declarations); } else if (cnt instanceof XSDAttributeDeclaration) { XSDAttributeDeclaration attriDec = (XSDAttributeDeclaration) cnt; attributeDeclarations.add(attriDec); } } } addElementDeclarationFromSchema(schema, declarations); Object[] schemaChildren = Util.filterOutDuplicatedElems( declarations.toArray(new XSDNamedComponent[declarations.size()])); attributeDeclarations.addAll(Arrays.asList(schemaChildren)); return attributeDeclarations.toArray(); }