private static void RemoveAttributesFromComplexType(XmlSchemaObjectCollection attributes, string xsdTypeName, UpccModelXsdTypes remainingXsdTypes)
        {
            foreach (XmlSchemaAttribute attribute in CopyValues(attributes))
            {
                string attributeName = attribute.QualifiedName.Name;

                if (!(remainingXsdTypes.XsdTypeContainsChild(xsdTypeName, attributeName)))
                {
                    attributes.Remove(attribute);
                }
            }
        }
        private static void RemoveElementsFromXsdGroup(XmlSchemaGroupBase xsdGroup, string xsdTypeName, UpccModelXsdTypes remainingXsdTypes)
        {
            foreach (XmlSchemaObject item in CopyValues(xsdGroup.Items))
            {
                if (item is XmlSchemaElement)
                {
                    string childName = ((XmlSchemaElement)item).QualifiedName.Name;

                    if (!(remainingXsdTypes.XsdTypeContainsChild(xsdTypeName, childName)))
                    {
                        xsdGroup.Items.Remove(item);
                    }
                }
                else if (item is XmlSchemaGroupBase)
                {
                    RemoveElementsFromXsdGroup((XmlSchemaGroupBase)item, xsdTypeName, remainingXsdTypes);
                }
            }
        }