#!/usr/bin/env python
# -*- coding: utf-8 -*- 

#
# Generated Tue Dec 04 18:30:32 2012 by generateDS.py version 2.7c.
#

import sys
import getopt
import re as re_

etree_ = None
Verbose_import_ = False
(   XMLParser_import_none, XMLParser_import_lxml,
    XMLParser_import_elementtree
    ) = range(3)
XMLParser_import_library = None
try:
    # lxml
    from lxml import etree as etree_
    XMLParser_import_library = XMLParser_import_lxml
    if Verbose_import_:
        print("running with lxml.etree")
except ImportError:
    try:
        # cElementTree from Python 2.5+
        import xml.etree.cElementTree as etree_
        XMLParser_import_library = XMLParser_import_elementtree
        if Verbose_import_:
            print("running with cElementTree on Python 2.5+")
    except ImportError:
        try:
            # ElementTree from Python 2.5+
            import xml.etree.ElementTree as etree_
            XMLParser_import_library = XMLParser_import_elementtree
            if Verbose_import_:
                print("running with ElementTree on Python 2.5+")
        except ImportError:
            try:
                # normal cElementTree install
                import cElementTree as etree_
                XMLParser_import_library = XMLParser_import_elementtree
                if Verbose_import_:
                    print("running with cElementTree")
            except ImportError:
                try:
                    # normal ElementTree install
                    import elementtree.ElementTree as etree_
                    XMLParser_import_library = XMLParser_import_elementtree
                    if Verbose_import_:
                        print("running with ElementTree")
                except ImportError:
                    raise ImportError("Failed to import ElementTree from any known place")

def parsexml_(*args, **kwargs):
    if (XMLParser_import_library == XMLParser_import_lxml and
        'parser' not in kwargs):
        # Use the lxml ElementTree compatible parser so that, e.g.,
        #   we ignore comments.
        kwargs['parser'] = etree_.ETCompatXMLParser()
    doc = etree_.parse(*args, **kwargs)
    return doc

#
# User methods
#
# Calls to the methods in these classes are generated by generateDS.py.
# You can replace these methods by re-implementing the following class
#   in a module named generatedssuper.py.

try:
    from generatedssuper import GeneratedsSuper
except ImportError, exp:

    class GeneratedsSuper(object):
        def gds_format_string(self, input_data, input_name=''):
            return input_data
        def gds_validate_string(self, input_data, node, input_name=''):
            return input_data
        def gds_format_integer(self, input_data, input_name=''):
            return '%d' % input_data
        def gds_validate_integer(self, input_data, node, input_name=''):
            return input_data
        def gds_format_integer_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_integer_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    fvalue = float(value)
                except (TypeError, ValueError), exp:
                    raise_parse_error(node, 'Requires sequence of integers')
            return input_data
        def gds_format_float(self, input_data, input_name=''):
            return '%f' % input_data
        def gds_validate_float(self, input_data, node, input_name=''):
            return input_data
        def gds_format_float_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_float_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    fvalue = float(value)
                except (TypeError, ValueError), exp:
                    raise_parse_error(node, 'Requires sequence of floats')
            return input_data
        def gds_format_double(self, input_data, input_name=''):
            return '%e' % input_data
        def gds_validate_double(self, input_data, node, input_name=''):
            return input_data
        def gds_format_double_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_double_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                try:
                    fvalue = float(value)
                except (TypeError, ValueError), exp:
                    raise_parse_error(node, 'Requires sequence of doubles')
            return input_data
        def gds_format_boolean(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_boolean(self, input_data, node, input_name=''):
            return input_data
        def gds_format_boolean_list(self, input_data, input_name=''):
            return '%s' % input_data
        def gds_validate_boolean_list(self, input_data, node, input_name=''):
            values = input_data.split()
            for value in values:
                if value not in ('true', '1', 'false', '0', ):
                    raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")')
            return input_data
        def gds_str_lower(self, instring):
            return instring.lower()
        def get_path_(self, node):
            path_list = []
            self.get_path_list_(node, path_list)
            path_list.reverse()
            path = '/'.join(path_list)
            return path
        Tag_strip_pattern_ = re_.compile(r'\{.*\}')
        def get_path_list_(self, node, path_list):
            if node is None:
                return
            tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
            if tag:
                path_list.append(tag)
            self.get_path_list_(node.getparent(), path_list)
        def get_class_obj_(self, node, default_class=None):
            class_obj1 = default_class
            if 'xsi' in node.nsmap:
                classname = node.get('{%s}type' % node.nsmap['xsi'])
                if classname is not None:
                    names = classname.split(':')
                    if len(names) == 2:
                        classname = names[1]
                    class_obj2 = globals().get(classname)
                    if class_obj2 is not None:
                        class_obj1 = class_obj2
            return class_obj1
        def gds_build_any(self, node, type_name=None):
            return None


#
# If you have installed IPython you can uncomment and use the following.
# IPython is available from http://ipython.scipy.org/.
#

## from IPython.Shell import IPShellEmbed
## args = ''
## ipshell = IPShellEmbed(args,
##     banner = 'Dropping into IPython',
##     exit_msg = 'Leaving Interpreter, back to program.')

# Then use the following line where and when you want to drop into the
# IPython shell:
#    ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')

#
# Globals
#

ExternalEncoding = 'ascii'
Tag_pattern_ = re_.compile(r'({.*})?(.*)')
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')

#
# Support/utility functions.
#

def showIndent(outfile, level, pretty_print=True):
    if pretty_print:
        for idx in range(level):
            outfile.write('    ')

def quote_xml(inStr):
    if not inStr:
        return ''
    s1 = (isinstance(inStr, basestring) and inStr or
          '%s' % inStr)
    s1 = s1.replace('&', '&amp;')
    s1 = s1.replace('<', '&lt;')
    s1 = s1.replace('>', '&gt;')
    return s1

def quote_attrib(inStr):
    s1 = (isinstance(inStr, basestring) and inStr or
          '%s' % inStr)
    s1 = s1.replace('&', '&amp;')
    s1 = s1.replace('<', '&lt;')
    s1 = s1.replace('>', '&gt;')
    if '"' in s1:
        if "'" in s1:
            s1 = '"%s"' % s1.replace('"', "&quot;")
        else:
            s1 = "'%s'" % s1
    else:
        s1 = '"%s"' % s1
    return s1

def quote_python(inStr):
    s1 = inStr
    if s1.find("'") == -1:
        if s1.find('\n') == -1:
            return "'%s'" % s1
        else:
            return "'''%s'''" % s1
    else:
        if s1.find('"') != -1:
            s1 = s1.replace('"', '\\"')
        if s1.find('\n') == -1:
            return '"%s"' % s1
        else:
            return '"""%s"""' % s1

def get_all_text_(node):
    if node.text is not None:
        text = node.text
    else:
        text = ''
    for child in node:
        if child.tail is not None:
            text += child.tail
    return text

def find_attr_value_(attr_name, node):
    attrs = node.attrib
    attr_parts = attr_name.split(':')
    value = None
    if len(attr_parts) == 1:
        value = attrs.get(attr_name)
    elif len(attr_parts) == 2:
        prefix, name = attr_parts
        namespace = node.nsmap.get(prefix)
        if namespace is not None:
            value = attrs.get('{%s}%s' % (namespace, name, ))
    return value


class GDSParseError(Exception):
    pass

def raise_parse_error(node, msg):
    if XMLParser_import_library == XMLParser_import_lxml:
        msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
    else:
        msg = '%s (element %s)' % (msg, node.tag, )
    raise GDSParseError(msg)


class MixedContainer:
    # Constants for category:
    CategoryNone = 0
    CategoryText = 1
    CategorySimple = 2
    CategoryComplex = 3
    # Constants for content_type:
    TypeNone = 0
    TypeText = 1
    TypeString = 2
    TypeInteger = 3
    TypeFloat = 4
    TypeDecimal = 5
    TypeDouble = 6
    TypeBoolean = 7
    def __init__(self, category, content_type, name, value):
        self.category = category
        self.content_type = content_type
        self.name = name
        self.value = value
    def getCategory(self):
        return self.category
    def getContenttype(self, content_type):
        return self.content_type
    def getValue(self):
        return self.value
    def getName(self):
        return self.name
    def export(self, outfile, level, name, namespace, pretty_print=True):
        if self.category == MixedContainer.CategoryText:
            # Prevent exporting empty content as empty lines.
            if self.value.strip(): 
                outfile.write(self.value)
        elif self.category == MixedContainer.CategorySimple:
            self.exportSimple(outfile, level, name)
        else:    # category == MixedContainer.CategoryComplex
            self.value.export(outfile, level, namespace, name, pretty_print)
    def exportSimple(self, outfile, level, name):
        if self.content_type == MixedContainer.TypeString:
            outfile.write('<%s>%s</%s>' % (self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeInteger or \
                self.content_type == MixedContainer.TypeBoolean:
            outfile.write('<%s>%d</%s>' % (self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeFloat or \
                self.content_type == MixedContainer.TypeDecimal:
            outfile.write('<%s>%f</%s>' % (self.name, self.value, self.name))
        elif self.content_type == MixedContainer.TypeDouble:
            outfile.write('<%s>%g</%s>' % (self.name, self.value, self.name))
    def exportLiteral(self, outfile, level, name):
        if self.category == MixedContainer.CategoryText:
            showIndent(outfile, level)
            outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \
                (self.category, self.content_type, self.name, self.value))
        elif self.category == MixedContainer.CategorySimple:
            showIndent(outfile, level)
            outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \
                (self.category, self.content_type, self.name, self.value))
        else:    # category == MixedContainer.CategoryComplex
            showIndent(outfile, level)
            outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \
                (self.category, self.content_type, self.name,))
            self.value.exportLiteral(outfile, level + 1)
            showIndent(outfile, level)
            outfile.write(')\n')


class MemberSpec_(object):
    def __init__(self, name='', data_type='', container=0):
        self.name = name
        self.data_type = data_type
        self.container = container
    def set_name(self, name): self.name = name
    def get_name(self): return self.name
    def set_data_type(self, data_type): self.data_type = data_type
    def get_data_type_chain(self): return self.data_type
    def get_data_type(self):
        if isinstance(self.data_type, list):
            if len(self.data_type) > 0:
                return self.data_type[-1]
            else:
                return 'xs:string'
        else:
            return self.data_type
    def set_container(self, container): self.container = container
    def get_container(self): return self.container

def _cast(typ, value):
    if typ is None or value is None:
        return value
    return typ(value)

#
# Data representation classes.
#

class AddressType(GeneratedsSuper):
    """Complex type that defines the structure of an address with geocode
    details for reuseDefines the type of address. An address type
    can be" Primary Address, Secondary Address, Rural Address,
    Military Address, etc.A unique address identifier such as postal
    delivery idetifier assigned to the address by local postal
    authority, e.g. DPID in Australia.Type of address ID used. e.g.
    DPID, etcA globally unique identifier assigned to the addressThe
    purpose the address is used for. E.g. Postal, residential,
    business, exchange, update, create, delete, etcMode of delivery
    of address. For example: rural route, normal delivery, post
    office box, etc. Status of the entity. e.g. Old, Current,
    Inactive, Active, etcA primary key to reference Address.A
    foreign key to reference attribute Key of Address."""
    subclass = None
    superclass = None
    def __init__(self, Status=None, LanguageCode=None, ValidFrom=None, DeliveryMode=None, AddressID=None, type_=None, ValidTo=None, DateValidFrom=None, AddressKey=None, DateValidTo=None, href=None, DataQualityType=None, Usage=None, AddressIDType=None, label=None, Type=None, ID=None, AddressKeyRef=None, FreeTextAddress=None, Country=None, AdministrativeArea=None, Locality=None, Thoroughfare=None, Premises=None, PostCode=None, RuralDelivery=None, PostalDeliveryPoint=None, PostOffice=None, GeoRSS=None, LocationByCoordinates=None):
        self.Status = _cast(None, Status)
        self.LanguageCode = _cast(None, LanguageCode)
        self.ValidFrom = _cast(None, ValidFrom)
        self.DeliveryMode = _cast(None, DeliveryMode)
        self.AddressID = _cast(None, AddressID)
        self.type_ = _cast(None, type_)
        self.ValidTo = _cast(None, ValidTo)
        self.DateValidFrom = _cast(None, DateValidFrom)
        self.AddressKey = _cast(None, AddressKey)
        self.DateValidTo = _cast(None, DateValidTo)
        self.href = _cast(None, href)
        self.DataQualityType = _cast(None, DataQualityType)
        self.Usage = _cast(None, Usage)
        self.AddressIDType = _cast(None, AddressIDType)
        self.label = _cast(None, label)
        self.Type = _cast(None, Type)
        self.ID = _cast(None, ID)
        self.AddressKeyRef = _cast(None, AddressKeyRef)
        self.FreeTextAddress = FreeTextAddress
        self.Country = Country
        self.AdministrativeArea = AdministrativeArea
        self.Locality = Locality
        self.Thoroughfare = Thoroughfare
        self.Premises = Premises
        self.PostCode = PostCode
        self.RuralDelivery = RuralDelivery
        self.PostalDeliveryPoint = PostalDeliveryPoint
        self.PostOffice = PostOffice
        self.GeoRSS = GeoRSS
        self.LocationByCoordinates = LocationByCoordinates
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if AddressType.subclass:
            return AddressType.subclass(*args_, **kwargs_)
        else:
            return AddressType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_FreeTextAddress(self): return self.FreeTextAddress
    def set_FreeTextAddress(self, FreeTextAddress): self.FreeTextAddress = FreeTextAddress
    def get_Country(self): return self.Country
    def set_Country(self, Country): self.Country = Country
    def get_AdministrativeArea(self): return self.AdministrativeArea
    def set_AdministrativeArea(self, AdministrativeArea): self.AdministrativeArea = AdministrativeArea
    def get_Locality(self): return self.Locality
    def set_Locality(self, Locality): self.Locality = Locality
    def get_Thoroughfare(self): return self.Thoroughfare
    def set_Thoroughfare(self, Thoroughfare): self.Thoroughfare = Thoroughfare
    def get_Premises(self): return self.Premises
    def set_Premises(self, Premises): self.Premises = Premises
    def get_PostCode(self): return self.PostCode
    def set_PostCode(self, PostCode): self.PostCode = PostCode
    def get_RuralDelivery(self): return self.RuralDelivery
    def set_RuralDelivery(self, RuralDelivery): self.RuralDelivery = RuralDelivery
    def get_PostalDeliveryPoint(self): return self.PostalDeliveryPoint
    def set_PostalDeliveryPoint(self, PostalDeliveryPoint): self.PostalDeliveryPoint = PostalDeliveryPoint
    def get_PostOffice(self): return self.PostOffice
    def set_PostOffice(self, PostOffice): self.PostOffice = PostOffice
    def get_GeoRSS(self): return self.GeoRSS
    def set_GeoRSS(self, GeoRSS): self.GeoRSS = GeoRSS
    def get_LocationByCoordinates(self): return self.LocationByCoordinates
    def set_LocationByCoordinates(self, LocationByCoordinates): self.LocationByCoordinates = LocationByCoordinates
    def get_Status(self): return self.Status
    def set_Status(self, Status): self.Status = Status
    def get_LanguageCode(self): return self.LanguageCode
    def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_DeliveryMode(self): return self.DeliveryMode
    def set_DeliveryMode(self, DeliveryMode): self.DeliveryMode = DeliveryMode
    def validate_DeliveryModeList(self, value):
        # Validate type DeliveryModeList, a restriction on xs:normalizedString.
        pass
    def get_AddressID(self): return self.AddressID
    def set_AddressID(self, AddressID): self.AddressID = AddressID
    def get_type(self): return self.type_
    def set_type(self, type_): self.type_ = type_
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_DateValidFrom(self): return self.DateValidFrom
    def set_DateValidFrom(self, DateValidFrom): self.DateValidFrom = DateValidFrom
    def get_AddressKey(self): return self.AddressKey
    def set_AddressKey(self, AddressKey): self.AddressKey = AddressKey
    def get_DateValidTo(self): return self.DateValidTo
    def set_DateValidTo(self, DateValidTo): self.DateValidTo = DateValidTo
    def get_href(self): return self.href
    def set_href(self, href): self.href = href
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_Usage(self): return self.Usage
    def set_Usage(self, Usage): self.Usage = Usage
    def validate_AddressUsageList(self, value):
        # Validate type AddressUsageList, a restriction on xs:normalizedString.
        pass
    def get_AddressIDType(self): return self.AddressIDType
    def set_AddressIDType(self, AddressIDType): self.AddressIDType = AddressIDType
    def validate_AddressIDTypeList(self, value):
        # Validate type AddressIDTypeList, a restriction on xs:normalizedString.
        pass
    def get_label(self): return self.label
    def set_label(self, label): self.label = label
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_AddressTypeList(self, value):
        # Validate type AddressTypeList, a restriction on xs:normalizedString.
        pass
    def get_ID(self): return self.ID
    def set_ID(self, ID): self.ID = ID
    def get_AddressKeyRef(self): return self.AddressKeyRef
    def set_AddressKeyRef(self, AddressKeyRef): self.AddressKeyRef = AddressKeyRef
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='AddressType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='AddressType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AddressType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Status is not None and 'Status' not in already_processed:
            already_processed.append('Status')
            outfile.write(' Status=%s' % (quote_attrib(self.Status), ))
        if self.LanguageCode is not None and 'LanguageCode' not in already_processed:
            already_processed.append('LanguageCode')
            outfile.write(' LanguageCode=%s' % (self.gds_format_string(quote_attrib(self.LanguageCode).encode(ExternalEncoding), input_name='LanguageCode'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.DeliveryMode is not None and 'DeliveryMode' not in already_processed:
            already_processed.append('DeliveryMode')
            outfile.write(' DeliveryMode=%s' % (quote_attrib(self.DeliveryMode), ))
        if self.AddressID is not None and 'AddressID' not in already_processed:
            already_processed.append('AddressID')
            outfile.write(' AddressID=%s' % (quote_attrib(self.AddressID), ))
        if self.type_ is not None and 'type_' not in already_processed:
            already_processed.append('type_')
            outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.DateValidFrom is not None and 'DateValidFrom' not in already_processed:
            already_processed.append('DateValidFrom')
            outfile.write(' DateValidFrom=%s' % (self.gds_format_string(quote_attrib(self.DateValidFrom).encode(ExternalEncoding), input_name='DateValidFrom'), ))
        if self.AddressKey is not None and 'AddressKey' not in already_processed:
            already_processed.append('AddressKey')
            outfile.write(' AddressKey=%s' % (quote_attrib(self.AddressKey), ))
        if self.DateValidTo is not None and 'DateValidTo' not in already_processed:
            already_processed.append('DateValidTo')
            outfile.write(' DateValidTo=%s' % (self.gds_format_string(quote_attrib(self.DateValidTo).encode(ExternalEncoding), input_name='DateValidTo'), ))
        if self.href is not None and 'href' not in already_processed:
            already_processed.append('href')
            outfile.write(' href=%s' % (self.gds_format_string(quote_attrib(self.href).encode(ExternalEncoding), input_name='href'), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.Usage is not None and 'Usage' not in already_processed:
            already_processed.append('Usage')
            outfile.write(' Usage=%s' % (quote_attrib(self.Usage), ))
        if self.AddressIDType is not None and 'AddressIDType' not in already_processed:
            already_processed.append('AddressIDType')
            outfile.write(' AddressIDType=%s' % (quote_attrib(self.AddressIDType), ))
        if self.label is not None and 'label' not in already_processed:
            already_processed.append('label')
            outfile.write(' label=%s' % (self.gds_format_string(quote_attrib(self.label).encode(ExternalEncoding), input_name='label'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
        if self.ID is not None and 'ID' not in already_processed:
            already_processed.append('ID')
            outfile.write(' ID=%s' % (quote_attrib(self.ID), ))
        if self.AddressKeyRef is not None and 'AddressKeyRef' not in already_processed:
            already_processed.append('AddressKeyRef')
            outfile.write(' AddressKeyRef=%s' % (quote_attrib(self.AddressKeyRef), ))
    def exportChildren(self, outfile, level, namespace_='', name_='AddressType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.FreeTextAddress is not None:
            self.FreeTextAddress.export(outfile, level, namespace_, name_='FreeTextAddress', pretty_print=pretty_print)
        if self.Country is not None:
            self.Country.export(outfile, level, namespace_, name_='Country', pretty_print=pretty_print)
        if self.AdministrativeArea is not None:
            self.AdministrativeArea.export(outfile, level, namespace_, name_='AdministrativeArea', pretty_print=pretty_print)
        if self.Locality is not None:
            self.Locality.export(outfile, level, namespace_, name_='Locality', pretty_print=pretty_print)
        if self.Thoroughfare is not None:
            self.Thoroughfare.export(outfile, level, namespace_, name_='Thoroughfare', pretty_print=pretty_print)
        if self.Premises is not None:
            self.Premises.export(outfile, level, namespace_, name_='Premises', pretty_print=pretty_print)
        if self.PostCode is not None:
            self.PostCode.export(outfile, level, namespace_, name_='PostCode', pretty_print=pretty_print)
        if self.RuralDelivery is not None:
            self.RuralDelivery.export(outfile, level, namespace_, name_='RuralDelivery', pretty_print=pretty_print)
        if self.PostalDeliveryPoint is not None:
            self.PostalDeliveryPoint.export(outfile, level, namespace_, name_='PostalDeliveryPoint', pretty_print=pretty_print)
        if self.PostOffice is not None:
            self.PostOffice.export(outfile, level, namespace_, name_='PostOffice', pretty_print=pretty_print)
        if self.GeoRSS is not None:
            self.GeoRSS.export(outfile, level, namespace_, name_='GeoRSS', pretty_print=pretty_print)
        if self.LocationByCoordinates is not None:
            self.LocationByCoordinates.export(outfile, level, namespace_, name_='LocationByCoordinates', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.FreeTextAddress is not None or
            self.Country is not None or
            self.AdministrativeArea is not None or
            self.Locality is not None or
            self.Thoroughfare is not None or
            self.Premises is not None or
            self.PostCode is not None or
            self.RuralDelivery is not None or
            self.PostalDeliveryPoint is not None or
            self.PostOffice is not None or
            self.GeoRSS is not None or
            self.LocationByCoordinates is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='AddressType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Status is not None and 'Status' not in already_processed:
            already_processed.append('Status')
            showIndent(outfile, level)
            outfile.write('Status = %s,\n' % (self.Status,))
        if self.LanguageCode is not None and 'LanguageCode' not in already_processed:
            already_processed.append('LanguageCode')
            showIndent(outfile, level)
            outfile.write('LanguageCode = "%s",\n' % (self.LanguageCode,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.DeliveryMode is not None and 'DeliveryMode' not in already_processed:
            already_processed.append('DeliveryMode')
            showIndent(outfile, level)
            outfile.write('DeliveryMode = "%s",\n' % (self.DeliveryMode,))
        if self.AddressID is not None and 'AddressID' not in already_processed:
            already_processed.append('AddressID')
            showIndent(outfile, level)
            outfile.write('AddressID = %s,\n' % (self.AddressID,))
        if self.type_ is not None and 'type_' not in already_processed:
            already_processed.append('type_')
            showIndent(outfile, level)
            outfile.write('type_ = "%s",\n' % (self.type_,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.DateValidFrom is not None and 'DateValidFrom' not in already_processed:
            already_processed.append('DateValidFrom')
            showIndent(outfile, level)
            outfile.write('DateValidFrom = "%s",\n' % (self.DateValidFrom,))
        if self.AddressKey is not None and 'AddressKey' not in already_processed:
            already_processed.append('AddressKey')
            showIndent(outfile, level)
            outfile.write('AddressKey = %s,\n' % (self.AddressKey,))
        if self.DateValidTo is not None and 'DateValidTo' not in already_processed:
            already_processed.append('DateValidTo')
            showIndent(outfile, level)
            outfile.write('DateValidTo = "%s",\n' % (self.DateValidTo,))
        if self.href is not None and 'href' not in already_processed:
            already_processed.append('href')
            showIndent(outfile, level)
            outfile.write('href = "%s",\n' % (self.href,))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.Usage is not None and 'Usage' not in already_processed:
            already_processed.append('Usage')
            showIndent(outfile, level)
            outfile.write('Usage = "%s",\n' % (self.Usage,))
        if self.AddressIDType is not None and 'AddressIDType' not in already_processed:
            already_processed.append('AddressIDType')
            showIndent(outfile, level)
            outfile.write('AddressIDType = "%s",\n' % (self.AddressIDType,))
        if self.label is not None and 'label' not in already_processed:
            already_processed.append('label')
            showIndent(outfile, level)
            outfile.write('label = "%s",\n' % (self.label,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        if self.ID is not None and 'ID' not in already_processed:
            already_processed.append('ID')
            showIndent(outfile, level)
            outfile.write('ID = %s,\n' % (self.ID,))
        if self.AddressKeyRef is not None and 'AddressKeyRef' not in already_processed:
            already_processed.append('AddressKeyRef')
            showIndent(outfile, level)
            outfile.write('AddressKeyRef = %s,\n' % (self.AddressKeyRef,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.FreeTextAddress is not None:
            showIndent(outfile, level)
            outfile.write('FreeTextAddress=model_.FreeTextAddressType(\n')
            self.FreeTextAddress.exportLiteral(outfile, level, name_='FreeTextAddress')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Country is not None:
            showIndent(outfile, level)
            outfile.write('Country=model_.CountryType1(\n')
            self.Country.exportLiteral(outfile, level, name_='Country')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.AdministrativeArea is not None:
            showIndent(outfile, level)
            outfile.write('AdministrativeArea=model_.AdministrativeAreaType(\n')
            self.AdministrativeArea.exportLiteral(outfile, level, name_='AdministrativeArea')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Locality is not None:
            showIndent(outfile, level)
            outfile.write('Locality=model_.LocalityType(\n')
            self.Locality.exportLiteral(outfile, level, name_='Locality')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Thoroughfare is not None:
            showIndent(outfile, level)
            outfile.write('Thoroughfare=model_.ThoroughfareType1(\n')
            self.Thoroughfare.exportLiteral(outfile, level, name_='Thoroughfare')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Premises is not None:
            showIndent(outfile, level)
            outfile.write('Premises=model_.PremisesType1(\n')
            self.Premises.exportLiteral(outfile, level, name_='Premises')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.PostCode is not None:
            showIndent(outfile, level)
            outfile.write('PostCode=model_.PostCodeType(\n')
            self.PostCode.exportLiteral(outfile, level, name_='PostCode')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.RuralDelivery is not None:
            showIndent(outfile, level)
            outfile.write('RuralDelivery=model_.RuralDeliveryType(\n')
            self.RuralDelivery.exportLiteral(outfile, level, name_='RuralDelivery')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.PostalDeliveryPoint is not None:
            showIndent(outfile, level)
            outfile.write('PostalDeliveryPoint=model_.PostalDeliveryPointType(\n')
            self.PostalDeliveryPoint.exportLiteral(outfile, level, name_='PostalDeliveryPoint')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.PostOffice is not None:
            showIndent(outfile, level)
            outfile.write('PostOffice=model_.PostOfficeType(\n')
            self.PostOffice.exportLiteral(outfile, level, name_='PostOffice')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.GeoRSS is not None:
            showIndent(outfile, level)
            outfile.write('GeoRSS=model_.GeoRSSType(\n')
            self.GeoRSS.exportLiteral(outfile, level, name_='GeoRSS')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.LocationByCoordinates is not None:
            showIndent(outfile, level)
            outfile.write('LocationByCoordinates=model_.LocationByCoordinatesType(\n')
            self.LocationByCoordinates.exportLiteral(outfile, level, name_='LocationByCoordinates')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Status', node)
        if value is not None and 'Status' not in already_processed:
            already_processed.append('Status')
            self.Status = value
        value = find_attr_value_('LanguageCode', node)
        if value is not None and 'LanguageCode' not in already_processed:
            already_processed.append('LanguageCode')
            self.LanguageCode = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('DeliveryMode', node)
        if value is not None and 'DeliveryMode' not in already_processed:
            already_processed.append('DeliveryMode')
            self.DeliveryMode = value
            self.validate_DeliveryModeList(self.DeliveryMode)    # validate type DeliveryModeList
        value = find_attr_value_('AddressID', node)
        if value is not None and 'AddressID' not in already_processed:
            already_processed.append('AddressID')
            self.AddressID = value
        value = find_attr_value_('type', node)
        if value is not None and 'type' not in already_processed:
            already_processed.append('type')
            self.type_ = value
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('DateValidFrom', node)
        if value is not None and 'DateValidFrom' not in already_processed:
            already_processed.append('DateValidFrom')
            self.DateValidFrom = value
        value = find_attr_value_('AddressKey', node)
        if value is not None and 'AddressKey' not in already_processed:
            already_processed.append('AddressKey')
            self.AddressKey = value
        value = find_attr_value_('DateValidTo', node)
        if value is not None and 'DateValidTo' not in already_processed:
            already_processed.append('DateValidTo')
            self.DateValidTo = value
        value = find_attr_value_('href', node)
        if value is not None and 'href' not in already_processed:
            already_processed.append('href')
            self.href = value
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('Usage', node)
        if value is not None and 'Usage' not in already_processed:
            already_processed.append('Usage')
            self.Usage = value
            self.validate_AddressUsageList(self.Usage)    # validate type AddressUsageList
        value = find_attr_value_('AddressIDType', node)
        if value is not None and 'AddressIDType' not in already_processed:
            already_processed.append('AddressIDType')
            self.AddressIDType = value
            self.validate_AddressIDTypeList(self.AddressIDType)    # validate type AddressIDTypeList
        value = find_attr_value_('label', node)
        if value is not None and 'label' not in already_processed:
            already_processed.append('label')
            self.label = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_AddressTypeList(self.Type)    # validate type AddressTypeList
        value = find_attr_value_('ID', node)
        if value is not None and 'ID' not in already_processed:
            already_processed.append('ID')
            self.ID = value
        value = find_attr_value_('AddressKeyRef', node)
        if value is not None and 'AddressKeyRef' not in already_processed:
            already_processed.append('AddressKeyRef')
            self.AddressKeyRef = value
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'FreeTextAddress':
            obj_ = FreeTextAddressType.factory()
            obj_.build(child_)
            self.set_FreeTextAddress(obj_)
        elif nodeName_ == 'Country':
            obj_ = CountryType1.factory()
            obj_.build(child_)
            self.set_Country(obj_)
        elif nodeName_ == 'AdministrativeArea':
            obj_ = AdministrativeAreaType.factory()
            obj_.build(child_)
            self.set_AdministrativeArea(obj_)
        elif nodeName_ == 'Locality':
            obj_ = LocalityType.factory()
            obj_.build(child_)
            self.set_Locality(obj_)
        elif nodeName_ == 'Thoroughfare':
            obj_ = ThoroughfareType1.factory()
            obj_.build(child_)
            self.set_Thoroughfare(obj_)
        elif nodeName_ == 'Premises':
            obj_ = PremisesType1.factory()
            obj_.build(child_)
            self.set_Premises(obj_)
        elif nodeName_ == 'PostCode':
            obj_ = PostCodeType.factory()
            obj_.build(child_)
            self.set_PostCode(obj_)
        elif nodeName_ == 'RuralDelivery':
            obj_ = RuralDeliveryType.factory()
            obj_.build(child_)
            self.set_RuralDelivery(obj_)
        elif nodeName_ == 'PostalDeliveryPoint':
            obj_ = PostalDeliveryPointType.factory()
            obj_.build(child_)
            self.set_PostalDeliveryPoint(obj_)
        elif nodeName_ == 'PostOffice':
            obj_ = PostOfficeType.factory()
            obj_.build(child_)
            self.set_PostOffice(obj_)
        elif nodeName_ == 'GeoRSS':
            obj_ = GeoRSSType.factory()
            obj_.build(child_)
            self.set_GeoRSS(obj_)
        elif nodeName_ == 'LocationByCoordinates':
            obj_ = LocationByCoordinatesType.factory()
            obj_.build(child_)
            self.set_LocationByCoordinates(obj_)
# end class AddressType


class CountryType(GeneratedsSuper):
    """Complex type that defines the name of the country and is reused in
    other CIQ specs"""
    subclass = None
    superclass = None
    def __init__(self, NameElement=None, extensiontype_=None):
        if NameElement is None:
            self.NameElement = []
        else:
            self.NameElement = NameElement
        self.anyAttributes_ = {}
        self.extensiontype_ = extensiontype_
    def factory(*args_, **kwargs_):
        if CountryType.subclass:
            return CountryType.subclass(*args_, **kwargs_)
        else:
            return CountryType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_NameElement(self): return self.NameElement
    def set_NameElement(self, NameElement): self.NameElement = NameElement
    def add_NameElement(self, value): self.NameElement.append(value)
    def insert_NameElement(self, index, value): self.NameElement[index] = value
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def get_extensiontype_(self): return self.extensiontype_
    def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
    def export(self, outfile, level, namespace_='', name_='CountryType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='CountryType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CountryType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
            already_processed.append('xsi:type')
            outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
            outfile.write(' xsi:type="%s"' % self.extensiontype_)
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='CountryType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for NameElement_ in self.NameElement:
            NameElement_.export(outfile, level, namespace_, name_='NameElement', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.NameElement
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='CountryType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('NameElement=[\n')
        level += 1
        for NameElement_ in self.NameElement:
            showIndent(outfile, level)
            outfile.write('model_.NameElementType4(\n')
            NameElement_.exportLiteral(outfile, level, name_='NameElementType4')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
        value = find_attr_value_('xsi:type', node)
        if value is not None and 'xsi:type' not in already_processed:
            already_processed.append('xsi:type')
            self.extensiontype_ = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'NameElement':
            obj_ = NameElementType4.factory()
            obj_.build(child_)
            self.NameElement.append(obj_)
# end class CountryType


class IdentifierType(GeneratedsSuper):
    """Complex type for internal reuseIndicates which part of number or
    identifier this element contains. Some "numbers" are as simple
    as 42 and some "numbers" are more like complex aplhanumberic
    identifiers as Postcodes in UK or Canada, e.g. M2H 2S5. It may
    be necessary to separate the "number" into sub-elements and
    indicate what type of information each of them contains."""
    subclass = None
    superclass = None
    def __init__(self, Abbreviation=None, Type=None, valueOf_=None):
        self.Abbreviation = _cast(bool, Abbreviation)
        self.Type = _cast(None, Type)
        self.valueOf_ = valueOf_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if IdentifierType.subclass:
            return IdentifierType.subclass(*args_, **kwargs_)
        else:
            return IdentifierType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Abbreviation(self): return self.Abbreviation
    def set_Abbreviation(self, Abbreviation): self.Abbreviation = Abbreviation
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_IdentifierElementTypeList(self, value):
        # Validate type IdentifierElementTypeList, a restriction on xs:normalizedString.
        pass
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='IdentifierType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='IdentifierType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='IdentifierType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            outfile.write(' Abbreviation="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.Abbreviation)), input_name='Abbreviation'))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
    def exportChildren(self, outfile, level, namespace_='', name_='IdentifierType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='IdentifierType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            showIndent(outfile, level)
            outfile.write('Abbreviation = %s,\n' % (self.Abbreviation,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Abbreviation', node)
        if value is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            if value in ('true', '1'):
                self.Abbreviation = True
            elif value in ('false', '0'):
                self.Abbreviation = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_IdentifierElementTypeList(self.Type)    # validate type IdentifierElementTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class IdentifierType


class PremisesType(GeneratedsSuper):
    """Complex type for internal reuse"""
    subclass = None
    superclass = None
    def __init__(self, NameElement=None, Number=None, extensiontype_=None):
        if NameElement is None:
            self.NameElement = []
        else:
            self.NameElement = NameElement
        if Number is None:
            self.Number = []
        else:
            self.Number = Number
        self.anyAttributes_ = {}
        self.extensiontype_ = extensiontype_
    def factory(*args_, **kwargs_):
        if PremisesType.subclass:
            return PremisesType.subclass(*args_, **kwargs_)
        else:
            return PremisesType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_NameElement(self): return self.NameElement
    def set_NameElement(self, NameElement): self.NameElement = NameElement
    def add_NameElement(self, value): self.NameElement.append(value)
    def insert_NameElement(self, index, value): self.NameElement[index] = value
    def get_Number(self): return self.Number
    def set_Number(self, Number): self.Number = Number
    def add_Number(self, value): self.Number.append(value)
    def insert_Number(self, index, value): self.Number[index] = value
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def get_extensiontype_(self): return self.extensiontype_
    def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
    def export(self, outfile, level, namespace_='', name_='PremisesType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='PremisesType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PremisesType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
            already_processed.append('xsi:type')
            outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
            outfile.write(' xsi:type="%s"' % self.extensiontype_)
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='PremisesType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for NameElement_ in self.NameElement:
            NameElement_.export(outfile, level, namespace_, name_='NameElement', pretty_print=pretty_print)
        for Number_ in self.Number:
            Number_.export(outfile, level, namespace_, name_='Number', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.NameElement or
            self.Number
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='PremisesType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('NameElement=[\n')
        level += 1
        for NameElement_ in self.NameElement:
            showIndent(outfile, level)
            outfile.write('model_.NameElementType5(\n')
            NameElement_.exportLiteral(outfile, level, name_='NameElementType5')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        showIndent(outfile, level)
        outfile.write('Number=[\n')
        level += 1
        for Number_ in self.Number:
            showIndent(outfile, level)
            outfile.write('model_.IdentifierType(\n')
            Number_.exportLiteral(outfile, level, name_='IdentifierType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
        value = find_attr_value_('xsi:type', node)
        if value is not None and 'xsi:type' not in already_processed:
            already_processed.append('xsi:type')
            self.extensiontype_ = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'NameElement':
            obj_ = NameElementType5.factory()
            obj_.build(child_)
            self.NameElement.append(obj_)
        elif nodeName_ == 'Number':
            obj_ = IdentifierType.factory()
            obj_.build(child_)
            self.Number.append(obj_)
# end class PremisesType


class ThoroughfareType(GeneratedsSuper):
    """Complex type for internal reuseType of thoroughfare. eg. primary
    road, secondary road, road branch (e.g. Lane 14), road sub
    branch (e.g. Alley 21), adjourning street, cross street, closest
    street, etcType of code use for thoroughfare"""
    subclass = None
    superclass = None
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, TypeCode=None, NameElement=None, Number=None, extensiontype_=None):
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Type = _cast(None, Type)
        self.TypeCode = _cast(None, TypeCode)
        if NameElement is None:
            self.NameElement = []
        else:
            self.NameElement = NameElement
        if Number is None:
            self.Number = []
        else:
            self.Number = Number
        self.anyAttributes_ = {}
        self.extensiontype_ = extensiontype_
    def factory(*args_, **kwargs_):
        if ThoroughfareType.subclass:
            return ThoroughfareType.subclass(*args_, **kwargs_)
        else:
            return ThoroughfareType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_NameElement(self): return self.NameElement
    def set_NameElement(self, NameElement): self.NameElement = NameElement
    def add_NameElement(self, value): self.NameElement.append(value)
    def insert_NameElement(self, index, value): self.NameElement[index] = value
    def get_Number(self): return self.Number
    def set_Number(self, Number): self.Number = Number
    def add_Number(self, value): self.Number.append(value)
    def insert_Number(self, index, value): self.Number[index] = value
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_ThoroughfareTypeList(self, value):
        # Validate type ThoroughfareTypeList, a restriction on xs:normalizedString.
        pass
    def get_TypeCode(self): return self.TypeCode
    def set_TypeCode(self, TypeCode): self.TypeCode = TypeCode
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def get_extensiontype_(self): return self.extensiontype_
    def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
    def export(self, outfile, level, namespace_='', name_='ThoroughfareType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ThoroughfareType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ThoroughfareType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
        if self.TypeCode is not None and 'TypeCode' not in already_processed:
            already_processed.append('TypeCode')
            outfile.write(' TypeCode=%s' % (quote_attrib(self.TypeCode), ))
        if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
            already_processed.append('xsi:type')
            outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
            outfile.write(' xsi:type="%s"' % self.extensiontype_)
    def exportChildren(self, outfile, level, namespace_='', name_='ThoroughfareType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for NameElement_ in self.NameElement:
            NameElement_.export(outfile, level, namespace_, name_='NameElement', pretty_print=pretty_print)
        for Number_ in self.Number:
            Number_.export(outfile, level, namespace_, name_='Number', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.NameElement or
            self.Number
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ThoroughfareType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        if self.TypeCode is not None and 'TypeCode' not in already_processed:
            already_processed.append('TypeCode')
            showIndent(outfile, level)
            outfile.write('TypeCode = %s,\n' % (self.TypeCode,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('NameElement=[\n')
        level += 1
        for NameElement_ in self.NameElement:
            showIndent(outfile, level)
            outfile.write('model_.NameElementType6(\n')
            NameElement_.exportLiteral(outfile, level, name_='NameElementType6')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        showIndent(outfile, level)
        outfile.write('Number=[\n')
        level += 1
        for Number_ in self.Number:
            showIndent(outfile, level)
            outfile.write('model_.IdentifierType(\n')
            Number_.exportLiteral(outfile, level, name_='IdentifierType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_ThoroughfareTypeList(self.Type)    # validate type ThoroughfareTypeList
        value = find_attr_value_('TypeCode', node)
        if value is not None and 'TypeCode' not in already_processed:
            already_processed.append('TypeCode')
            self.TypeCode = value
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
        value = find_attr_value_('xsi:type', node)
        if value is not None and 'xsi:type' not in already_processed:
            already_processed.append('xsi:type')
            self.extensiontype_ = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'NameElement':
            obj_ = NameElementType6.factory()
            obj_.build(child_)
            self.NameElement.append(obj_)
        elif nodeName_ == 'Number':
            obj_ = IdentifierType.factory()
            obj_.build(child_)
            self.Number.append(obj_)
# end class ThoroughfareType


class FreeTextAddressType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, ValidTo=None, ValidFrom=None, DataQualityType=None, AddressLine=None):
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.DataQualityType = _cast(None, DataQualityType)
        if AddressLine is None:
            self.AddressLine = []
        else:
            self.AddressLine = AddressLine
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if FreeTextAddressType.subclass:
            return FreeTextAddressType.subclass(*args_, **kwargs_)
        else:
            return FreeTextAddressType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_AddressLine(self): return self.AddressLine
    def set_AddressLine(self, AddressLine): self.AddressLine = AddressLine
    def add_AddressLine(self, value): self.AddressLine.append(value)
    def insert_AddressLine(self, index, value): self.AddressLine[index] = value
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='FreeTextAddressType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='FreeTextAddressType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='FreeTextAddressType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
    def exportChildren(self, outfile, level, namespace_='', name_='FreeTextAddressType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for AddressLine_ in self.AddressLine:
            AddressLine_.export(outfile, level, namespace_, name_='AddressLine', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.AddressLine
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='FreeTextAddressType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('AddressLine=[\n')
        level += 1
        for AddressLine_ in self.AddressLine:
            showIndent(outfile, level)
            outfile.write('model_.AddressLineType(\n')
            AddressLine_.exportLiteral(outfile, level, name_='AddressLineType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'AddressLine':
            obj_ = AddressLineType.factory()
            obj_.build(child_)
            self.AddressLine.append(obj_)
# end class FreeTextAddressType


class AddressLineType(GeneratedsSuper):
    """What does the address line describe? e.g. Street details, suburb
    details, post code details, whole address, etc"""
    subclass = None
    superclass = None
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, valueOf_=None):
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Type = _cast(None, Type)
        self.valueOf_ = valueOf_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if AddressLineType.subclass:
            return AddressLineType.subclass(*args_, **kwargs_)
        else:
            return AddressLineType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_AddressLineTypeList(self, value):
        # Validate type AddressLineTypeList, a restriction on xs:normalizedString.
        pass
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='AddressLineType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='AddressLineType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AddressLineType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
    def exportChildren(self, outfile, level, namespace_='', name_='AddressLineType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='AddressLineType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_AddressLineTypeList(self.Type)    # validate type AddressLineTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class AddressLineType


class CountryType1(CountryType):
    subclass = None
    superclass = CountryType
    def __init__(self, NameElement=None):
        super(CountryType1, self).__init__(NameElement, )
        pass
    def factory(*args_, **kwargs_):
        if CountryType1.subclass:
            return CountryType1.subclass(*args_, **kwargs_)
        else:
            return CountryType1(*args_, **kwargs_)
    factory = staticmethod(factory)
    def export(self, outfile, level, namespace_='', name_='CountryType1', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='CountryType1')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='CountryType1'):
        super(CountryType1, self).exportAttributes(outfile, level, already_processed, namespace_, name_='CountryType1')
    def exportChildren(self, outfile, level, namespace_='', name_='CountryType1', fromsubclass_=False, pretty_print=True):
        super(CountryType1, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
    def hasContent_(self):
        if (
            super(CountryType1, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='CountryType1'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        super(CountryType1, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(CountryType1, self).exportLiteralChildren(outfile, level, name_)
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        super(CountryType1, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        super(CountryType1, self).buildChildren(child_, node, nodeName_, True)
        pass
# end class CountryType1


class AdministrativeAreaType(GeneratedsSuper):
    """Type of administrative area. e.g. state, city, town, etc"""
    subclass = None
    superclass = None
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, NameElement=None, SubAdministrativeArea=None):
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Type = _cast(None, Type)
        if NameElement is None:
            self.NameElement = []
        else:
            self.NameElement = NameElement
        self.SubAdministrativeArea = SubAdministrativeArea
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if AdministrativeAreaType.subclass:
            return AdministrativeAreaType.subclass(*args_, **kwargs_)
        else:
            return AdministrativeAreaType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_NameElement(self): return self.NameElement
    def set_NameElement(self, NameElement): self.NameElement = NameElement
    def add_NameElement(self, value): self.NameElement.append(value)
    def insert_NameElement(self, index, value): self.NameElement[index] = value
    def get_SubAdministrativeArea(self): return self.SubAdministrativeArea
    def set_SubAdministrativeArea(self, SubAdministrativeArea): self.SubAdministrativeArea = SubAdministrativeArea
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_AdministrativeAreaTypeList(self, value):
        # Validate type AdministrativeAreaTypeList, a restriction on xs:normalizedString.
        pass
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='AdministrativeAreaType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='AdministrativeAreaType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='AdministrativeAreaType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
    def exportChildren(self, outfile, level, namespace_='', name_='AdministrativeAreaType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for NameElement_ in self.NameElement:
            NameElement_.export(outfile, level, namespace_, name_='NameElement', pretty_print=pretty_print)
        if self.SubAdministrativeArea is not None:
            self.SubAdministrativeArea.export(outfile, level, namespace_, name_='SubAdministrativeArea', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.NameElement or
            self.SubAdministrativeArea is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='AdministrativeAreaType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('NameElement=[\n')
        level += 1
        for NameElement_ in self.NameElement:
            showIndent(outfile, level)
            outfile.write('model_.NameElementType(\n')
            NameElement_.exportLiteral(outfile, level, name_='NameElementType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.SubAdministrativeArea is not None:
            showIndent(outfile, level)
            outfile.write('SubAdministrativeArea=model_.SubAdministrativeAreaType(\n')
            self.SubAdministrativeArea.exportLiteral(outfile, level, name_='SubAdministrativeArea')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_AdministrativeAreaTypeList(self.Type)    # validate type AdministrativeAreaTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'NameElement':
            obj_ = NameElementType.factory()
            obj_.build(child_)
            self.NameElement.append(obj_)
        elif nodeName_ == 'SubAdministrativeArea':
            obj_ = SubAdministrativeAreaType.factory()
            obj_.build(child_)
            self.set_SubAdministrativeArea(obj_)
# end class AdministrativeAreaType


class NameElementType(GeneratedsSuper):
    """semantics of data associated with nameName of administrative area
    represented as a code. e.g. "COL" for COLORADOType of code used
    to represent name as a code"""
    subclass = None
    superclass = None
    def __init__(self, Abbreviation=None, NameType=None, NameCodeType=None, NameCode=None, valueOf_=None):
        self.Abbreviation = _cast(bool, Abbreviation)
        self.NameType = _cast(None, NameType)
        self.NameCodeType = _cast(None, NameCodeType)
        self.NameCode = _cast(None, NameCode)
        self.valueOf_ = valueOf_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if NameElementType.subclass:
            return NameElementType.subclass(*args_, **kwargs_)
        else:
            return NameElementType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Abbreviation(self): return self.Abbreviation
    def set_Abbreviation(self, Abbreviation): self.Abbreviation = Abbreviation
    def get_NameType(self): return self.NameType
    def set_NameType(self, NameType): self.NameType = NameType
    def validate_AdministrativeAreaNameTypeList(self, value):
        # Validate type AdministrativeAreaNameTypeList, a restriction on xs:normalizedString.
        pass
    def get_NameCodeType(self): return self.NameCodeType
    def set_NameCodeType(self, NameCodeType): self.NameCodeType = NameCodeType
    def get_NameCode(self): return self.NameCode
    def set_NameCode(self, NameCode): self.NameCode = NameCode
    def validate_AdministrativeAreaNameCodeList(self, value):
        # Validate type AdministrativeAreaNameCodeList, a restriction on xs:normalizedString.
        pass
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='NameElementType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='NameElementType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='NameElementType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            outfile.write(' Abbreviation="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.Abbreviation)), input_name='Abbreviation'))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            outfile.write(' NameType=%s' % (quote_attrib(self.NameType), ))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            outfile.write(' NameCodeType=%s' % (quote_attrib(self.NameCodeType), ))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            outfile.write(' NameCode=%s' % (quote_attrib(self.NameCode), ))
    def exportChildren(self, outfile, level, namespace_='', name_='NameElementType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='NameElementType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            showIndent(outfile, level)
            outfile.write('Abbreviation = %s,\n' % (self.Abbreviation,))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            showIndent(outfile, level)
            outfile.write('NameType = "%s",\n' % (self.NameType,))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            showIndent(outfile, level)
            outfile.write('NameCodeType = %s,\n' % (self.NameCodeType,))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            showIndent(outfile, level)
            outfile.write('NameCode = "%s",\n' % (self.NameCode,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Abbreviation', node)
        if value is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            if value in ('true', '1'):
                self.Abbreviation = True
            elif value in ('false', '0'):
                self.Abbreviation = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('NameType', node)
        if value is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            self.NameType = value
            self.validate_AdministrativeAreaNameTypeList(self.NameType)    # validate type AdministrativeAreaNameTypeList
        value = find_attr_value_('NameCodeType', node)
        if value is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            self.NameCodeType = value
        value = find_attr_value_('NameCode', node)
        if value is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            self.NameCode = value
            self.validate_AdministrativeAreaNameCodeList(self.NameCode)    # validate type AdministrativeAreaNameCodeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class NameElementType


class SubAdministrativeAreaType(GeneratedsSuper):
    """Type of sub administrative area"""
    subclass = None
    superclass = None
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, NameElement=None):
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Type = _cast(None, Type)
        if NameElement is None:
            self.NameElement = []
        else:
            self.NameElement = NameElement
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if SubAdministrativeAreaType.subclass:
            return SubAdministrativeAreaType.subclass(*args_, **kwargs_)
        else:
            return SubAdministrativeAreaType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_NameElement(self): return self.NameElement
    def set_NameElement(self, NameElement): self.NameElement = NameElement
    def add_NameElement(self, value): self.NameElement.append(value)
    def insert_NameElement(self, index, value): self.NameElement[index] = value
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_SubAdministrativeAreaTypeList(self, value):
        # Validate type SubAdministrativeAreaTypeList, a restriction on xs:normalizedString.
        pass
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='SubAdministrativeAreaType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='SubAdministrativeAreaType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SubAdministrativeAreaType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
    def exportChildren(self, outfile, level, namespace_='', name_='SubAdministrativeAreaType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for NameElement_ in self.NameElement:
            NameElement_.export(outfile, level, namespace_, name_='NameElement', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.NameElement
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='SubAdministrativeAreaType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('NameElement=[\n')
        level += 1
        for NameElement_ in self.NameElement:
            showIndent(outfile, level)
            outfile.write('model_.NameElementType1(\n')
            NameElement_.exportLiteral(outfile, level, name_='NameElementType1')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_SubAdministrativeAreaTypeList(self.Type)    # validate type SubAdministrativeAreaTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'NameElement':
            obj_ = NameElementType1.factory()
            obj_.build(child_)
            self.NameElement.append(obj_)
# end class SubAdministrativeAreaType


class NameElementType1(GeneratedsSuper):
    """semantics of data associated with nameName of administrative area
    represented as a code. e.g. "COL" for COLORADOType of code used
    to represent name as a code"""
    subclass = None
    superclass = None
    def __init__(self, Abbreviation=None, NameType=None, NameCodeType=None, NameCode=None, valueOf_=None):
        self.Abbreviation = _cast(bool, Abbreviation)
        self.NameType = _cast(None, NameType)
        self.NameCodeType = _cast(None, NameCodeType)
        self.NameCode = _cast(None, NameCode)
        self.valueOf_ = valueOf_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if NameElementType1.subclass:
            return NameElementType1.subclass(*args_, **kwargs_)
        else:
            return NameElementType1(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Abbreviation(self): return self.Abbreviation
    def set_Abbreviation(self, Abbreviation): self.Abbreviation = Abbreviation
    def get_NameType(self): return self.NameType
    def set_NameType(self, NameType): self.NameType = NameType
    def validate_SubAdministrativeAreaNameTypeList(self, value):
        # Validate type SubAdministrativeAreaNameTypeList, a restriction on xs:normalizedString.
        pass
    def get_NameCodeType(self): return self.NameCodeType
    def set_NameCodeType(self, NameCodeType): self.NameCodeType = NameCodeType
    def get_NameCode(self): return self.NameCode
    def set_NameCode(self, NameCode): self.NameCode = NameCode
    def validate_SubAdministrativeAreaNameCodeList(self, value):
        # Validate type SubAdministrativeAreaNameCodeList, a restriction on xs:normalizedString.
        pass
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='NameElementType1', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='NameElementType1')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='NameElementType1'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            outfile.write(' Abbreviation="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.Abbreviation)), input_name='Abbreviation'))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            outfile.write(' NameType=%s' % (quote_attrib(self.NameType), ))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            outfile.write(' NameCodeType=%s' % (quote_attrib(self.NameCodeType), ))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            outfile.write(' NameCode=%s' % (quote_attrib(self.NameCode), ))
    def exportChildren(self, outfile, level, namespace_='', name_='NameElementType1', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='NameElementType1'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            showIndent(outfile, level)
            outfile.write('Abbreviation = %s,\n' % (self.Abbreviation,))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            showIndent(outfile, level)
            outfile.write('NameType = "%s",\n' % (self.NameType,))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            showIndent(outfile, level)
            outfile.write('NameCodeType = %s,\n' % (self.NameCodeType,))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            showIndent(outfile, level)
            outfile.write('NameCode = "%s",\n' % (self.NameCode,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Abbreviation', node)
        if value is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            if value in ('true', '1'):
                self.Abbreviation = True
            elif value in ('false', '0'):
                self.Abbreviation = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('NameType', node)
        if value is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            self.NameType = value
            self.validate_SubAdministrativeAreaNameTypeList(self.NameType)    # validate type SubAdministrativeAreaNameTypeList
        value = find_attr_value_('NameCodeType', node)
        if value is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            self.NameCodeType = value
        value = find_attr_value_('NameCode', node)
        if value is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            self.NameCode = value
            self.validate_SubAdministrativeAreaNameCodeList(self.NameCode)    # validate type SubAdministrativeAreaNameCodeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class NameElementType1


class LocalityType(GeneratedsSuper):
    """Type of locality. e.g. suburb, area, zone, village, etc"""
    subclass = None
    superclass = None
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, NameElement=None, SubLocality=None):
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Type = _cast(None, Type)
        if NameElement is None:
            self.NameElement = []
        else:
            self.NameElement = NameElement
        self.SubLocality = SubLocality
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if LocalityType.subclass:
            return LocalityType.subclass(*args_, **kwargs_)
        else:
            return LocalityType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_NameElement(self): return self.NameElement
    def set_NameElement(self, NameElement): self.NameElement = NameElement
    def add_NameElement(self, value): self.NameElement.append(value)
    def insert_NameElement(self, index, value): self.NameElement[index] = value
    def get_SubLocality(self): return self.SubLocality
    def set_SubLocality(self, SubLocality): self.SubLocality = SubLocality
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_LocalityTypeList(self, value):
        # Validate type LocalityTypeList, a restriction on xs:normalizedString.
        pass
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='LocalityType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='LocalityType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LocalityType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
    def exportChildren(self, outfile, level, namespace_='', name_='LocalityType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for NameElement_ in self.NameElement:
            NameElement_.export(outfile, level, namespace_, name_='NameElement', pretty_print=pretty_print)
        if self.SubLocality is not None:
            self.SubLocality.export(outfile, level, namespace_, name_='SubLocality', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.NameElement or
            self.SubLocality is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='LocalityType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('NameElement=[\n')
        level += 1
        for NameElement_ in self.NameElement:
            showIndent(outfile, level)
            outfile.write('model_.NameElementType2(\n')
            NameElement_.exportLiteral(outfile, level, name_='NameElementType2')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.SubLocality is not None:
            showIndent(outfile, level)
            outfile.write('SubLocality=model_.SubLocalityType(\n')
            self.SubLocality.exportLiteral(outfile, level, name_='SubLocality')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_LocalityTypeList(self.Type)    # validate type LocalityTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'NameElement':
            obj_ = NameElementType2.factory()
            obj_.build(child_)
            self.NameElement.append(obj_)
        elif nodeName_ == 'SubLocality':
            obj_ = SubLocalityType.factory()
            obj_.build(child_)
            self.set_SubLocality(obj_)
# end class LocalityType


class NameElementType2(GeneratedsSuper):
    """semantics of data associated with namename of locality represented
    as a codetype of code used to represent name as a code"""
    subclass = None
    superclass = None
    def __init__(self, Abbreviation=None, NameType=None, NameCodeType=None, NameCode=None, valueOf_=None):
        self.Abbreviation = _cast(bool, Abbreviation)
        self.NameType = _cast(None, NameType)
        self.NameCodeType = _cast(None, NameCodeType)
        self.NameCode = _cast(None, NameCode)
        self.valueOf_ = valueOf_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if NameElementType2.subclass:
            return NameElementType2.subclass(*args_, **kwargs_)
        else:
            return NameElementType2(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Abbreviation(self): return self.Abbreviation
    def set_Abbreviation(self, Abbreviation): self.Abbreviation = Abbreviation
    def get_NameType(self): return self.NameType
    def set_NameType(self, NameType): self.NameType = NameType
    def validate_LocalityNameTypeList(self, value):
        # Validate type LocalityNameTypeList, a restriction on xs:normalizedString.
        pass
    def get_NameCodeType(self): return self.NameCodeType
    def set_NameCodeType(self, NameCodeType): self.NameCodeType = NameCodeType
    def get_NameCode(self): return self.NameCode
    def set_NameCode(self, NameCode): self.NameCode = NameCode
    def validate_LocalityNameCodeList(self, value):
        # Validate type LocalityNameCodeList, a restriction on xs:normalizedString.
        pass
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='NameElementType2', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='NameElementType2')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='NameElementType2'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            outfile.write(' Abbreviation="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.Abbreviation)), input_name='Abbreviation'))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            outfile.write(' NameType=%s' % (quote_attrib(self.NameType), ))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            outfile.write(' NameCodeType=%s' % (quote_attrib(self.NameCodeType), ))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            outfile.write(' NameCode=%s' % (quote_attrib(self.NameCode), ))
    def exportChildren(self, outfile, level, namespace_='', name_='NameElementType2', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='NameElementType2'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            showIndent(outfile, level)
            outfile.write('Abbreviation = %s,\n' % (self.Abbreviation,))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            showIndent(outfile, level)
            outfile.write('NameType = "%s",\n' % (self.NameType,))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            showIndent(outfile, level)
            outfile.write('NameCodeType = %s,\n' % (self.NameCodeType,))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            showIndent(outfile, level)
            outfile.write('NameCode = "%s",\n' % (self.NameCode,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Abbreviation', node)
        if value is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            if value in ('true', '1'):
                self.Abbreviation = True
            elif value in ('false', '0'):
                self.Abbreviation = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('NameType', node)
        if value is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            self.NameType = value
            self.validate_LocalityNameTypeList(self.NameType)    # validate type LocalityNameTypeList
        value = find_attr_value_('NameCodeType', node)
        if value is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            self.NameCodeType = value
        value = find_attr_value_('NameCode', node)
        if value is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            self.NameCode = value
            self.validate_LocalityNameCodeList(self.NameCode)    # validate type LocalityNameCodeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class NameElementType2


class SubLocalityType(GeneratedsSuper):
    """Type of sub locality"""
    subclass = None
    superclass = None
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, NameElement=None):
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Type = _cast(None, Type)
        if NameElement is None:
            self.NameElement = []
        else:
            self.NameElement = NameElement
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if SubLocalityType.subclass:
            return SubLocalityType.subclass(*args_, **kwargs_)
        else:
            return SubLocalityType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_NameElement(self): return self.NameElement
    def set_NameElement(self, NameElement): self.NameElement = NameElement
    def add_NameElement(self, value): self.NameElement.append(value)
    def insert_NameElement(self, index, value): self.NameElement[index] = value
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_SubLocalityTypeList(self, value):
        # Validate type SubLocalityTypeList, a restriction on xs:normalizedString.
        pass
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='SubLocalityType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='SubLocalityType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SubLocalityType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
    def exportChildren(self, outfile, level, namespace_='', name_='SubLocalityType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for NameElement_ in self.NameElement:
            NameElement_.export(outfile, level, namespace_, name_='NameElement', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.NameElement
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='SubLocalityType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('NameElement=[\n')
        level += 1
        for NameElement_ in self.NameElement:
            showIndent(outfile, level)
            outfile.write('model_.NameElementType3(\n')
            NameElement_.exportLiteral(outfile, level, name_='NameElementType3')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_SubLocalityTypeList(self.Type)    # validate type SubLocalityTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'NameElement':
            obj_ = NameElementType3.factory()
            obj_.build(child_)
            self.NameElement.append(obj_)
# end class SubLocalityType


class NameElementType3(GeneratedsSuper):
    """semantics of data associated with namename of locality represented
    as a codetype of code used to represent name as a code"""
    subclass = None
    superclass = None
    def __init__(self, Abbreviation=None, NameType=None, NameCodeType=None, NameCode=None, valueOf_=None):
        self.Abbreviation = _cast(bool, Abbreviation)
        self.NameType = _cast(None, NameType)
        self.NameCodeType = _cast(None, NameCodeType)
        self.NameCode = _cast(None, NameCode)
        self.valueOf_ = valueOf_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if NameElementType3.subclass:
            return NameElementType3.subclass(*args_, **kwargs_)
        else:
            return NameElementType3(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Abbreviation(self): return self.Abbreviation
    def set_Abbreviation(self, Abbreviation): self.Abbreviation = Abbreviation
    def get_NameType(self): return self.NameType
    def set_NameType(self, NameType): self.NameType = NameType
    def validate_SubLocalityNameTypeList(self, value):
        # Validate type SubLocalityNameTypeList, a restriction on xs:normalizedString.
        pass
    def get_NameCodeType(self): return self.NameCodeType
    def set_NameCodeType(self, NameCodeType): self.NameCodeType = NameCodeType
    def get_NameCode(self): return self.NameCode
    def set_NameCode(self, NameCode): self.NameCode = NameCode
    def validate_SubLocalityNameCodeList(self, value):
        # Validate type SubLocalityNameCodeList, a restriction on xs:normalizedString.
        pass
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='NameElementType3', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='NameElementType3')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='NameElementType3'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            outfile.write(' Abbreviation="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.Abbreviation)), input_name='Abbreviation'))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            outfile.write(' NameType=%s' % (quote_attrib(self.NameType), ))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            outfile.write(' NameCodeType=%s' % (quote_attrib(self.NameCodeType), ))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            outfile.write(' NameCode=%s' % (quote_attrib(self.NameCode), ))
    def exportChildren(self, outfile, level, namespace_='', name_='NameElementType3', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='NameElementType3'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            showIndent(outfile, level)
            outfile.write('Abbreviation = %s,\n' % (self.Abbreviation,))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            showIndent(outfile, level)
            outfile.write('NameType = "%s",\n' % (self.NameType,))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            showIndent(outfile, level)
            outfile.write('NameCodeType = %s,\n' % (self.NameCodeType,))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            showIndent(outfile, level)
            outfile.write('NameCode = "%s",\n' % (self.NameCode,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Abbreviation', node)
        if value is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            if value in ('true', '1'):
                self.Abbreviation = True
            elif value in ('false', '0'):
                self.Abbreviation = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('NameType', node)
        if value is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            self.NameType = value
            self.validate_SubLocalityNameTypeList(self.NameType)    # validate type SubLocalityNameTypeList
        value = find_attr_value_('NameCodeType', node)
        if value is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            self.NameCodeType = value
        value = find_attr_value_('NameCode', node)
        if value is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            self.NameCode = value
            self.validate_SubLocalityNameCodeList(self.NameCode)    # validate type SubLocalityNameCodeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class NameElementType3


class ThoroughfareType1(ThoroughfareType):
    subclass = None
    superclass = ThoroughfareType
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, TypeCode=None, NameElement=None, Number=None, SubThoroughfare=None):
        super(ThoroughfareType1, self).__init__(DataQualityType, ValidTo, ValidFrom, Type, TypeCode, NameElement, Number, )
        if SubThoroughfare is None:
            self.SubThoroughfare = []
        else:
            self.SubThoroughfare = SubThoroughfare
    def factory(*args_, **kwargs_):
        if ThoroughfareType1.subclass:
            return ThoroughfareType1.subclass(*args_, **kwargs_)
        else:
            return ThoroughfareType1(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SubThoroughfare(self): return self.SubThoroughfare
    def set_SubThoroughfare(self, SubThoroughfare): self.SubThoroughfare = SubThoroughfare
    def add_SubThoroughfare(self, value): self.SubThoroughfare.append(value)
    def insert_SubThoroughfare(self, index, value): self.SubThoroughfare[index] = value
    def export(self, outfile, level, namespace_='', name_='ThoroughfareType1', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='ThoroughfareType1')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ThoroughfareType1'):
        super(ThoroughfareType1, self).exportAttributes(outfile, level, already_processed, namespace_, name_='ThoroughfareType1')
    def exportChildren(self, outfile, level, namespace_='', name_='ThoroughfareType1', fromsubclass_=False, pretty_print=True):
        super(ThoroughfareType1, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for SubThoroughfare_ in self.SubThoroughfare:
            SubThoroughfare_.export(outfile, level, namespace_, name_='SubThoroughfare', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.SubThoroughfare or
            super(ThoroughfareType1, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='ThoroughfareType1'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        super(ThoroughfareType1, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(ThoroughfareType1, self).exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('SubThoroughfare=[\n')
        level += 1
        for SubThoroughfare_ in self.SubThoroughfare:
            showIndent(outfile, level)
            outfile.write('model_.SubThoroughfareType(\n')
            SubThoroughfare_.exportLiteral(outfile, level, name_='SubThoroughfareType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        super(ThoroughfareType1, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SubThoroughfare':
            obj_ = SubThoroughfareType.factory()
            obj_.build(child_)
            self.SubThoroughfare.append(obj_)
        super(ThoroughfareType1, self).buildChildren(child_, node, nodeName_, True)
# end class ThoroughfareType1


class SubThoroughfareType(ThoroughfareType):
    subclass = None
    superclass = ThoroughfareType
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, TypeCode=None, NameElement=None, Number=None):
        super(SubThoroughfareType, self).__init__(DataQualityType, ValidTo, ValidFrom, Type, TypeCode, NameElement, Number, )
        pass
    def factory(*args_, **kwargs_):
        if SubThoroughfareType.subclass:
            return SubThoroughfareType.subclass(*args_, **kwargs_)
        else:
            return SubThoroughfareType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def export(self, outfile, level, namespace_='', name_='SubThoroughfareType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='SubThoroughfareType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SubThoroughfareType'):
        super(SubThoroughfareType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SubThoroughfareType')
    def exportChildren(self, outfile, level, namespace_='', name_='SubThoroughfareType', fromsubclass_=False, pretty_print=True):
        super(SubThoroughfareType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
    def hasContent_(self):
        if (
            super(SubThoroughfareType, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='SubThoroughfareType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        super(SubThoroughfareType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(SubThoroughfareType, self).exportLiteralChildren(outfile, level, name_)
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        super(SubThoroughfareType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        super(SubThoroughfareType, self).buildChildren(child_, node, nodeName_, True)
        pass
# end class SubThoroughfareType


class PremisesType1(PremisesType):
    """Type of code use for Premises Type attribute"""
    subclass = None
    superclass = PremisesType
    def __init__(self, NameElement=None, Number=None, Type=None, TypeCode=None, SubPremises=None):
        super(PremisesType1, self).__init__(NameElement, Number, )
        self.Type = _cast(None, Type)
        self.TypeCode = _cast(None, TypeCode)
        if SubPremises is None:
            self.SubPremises = []
        else:
            self.SubPremises = SubPremises
    def factory(*args_, **kwargs_):
        if PremisesType1.subclass:
            return PremisesType1.subclass(*args_, **kwargs_)
        else:
            return PremisesType1(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SubPremises(self): return self.SubPremises
    def set_SubPremises(self, SubPremises): self.SubPremises = SubPremises
    def add_SubPremises(self, value): self.SubPremises.append(value)
    def insert_SubPremises(self, index, value): self.SubPremises[index] = value
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_PremisesTypeList(self, value):
        # Validate type PremisesTypeList, a restriction on xs:normalizedString.
        pass
    def get_TypeCode(self): return self.TypeCode
    def set_TypeCode(self, TypeCode): self.TypeCode = TypeCode
    def export(self, outfile, level, namespace_='', name_='PremisesType1', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='PremisesType1')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PremisesType1'):
        super(PremisesType1, self).exportAttributes(outfile, level, already_processed, namespace_, name_='PremisesType1')
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
        if self.TypeCode is not None and 'TypeCode' not in already_processed:
            already_processed.append('TypeCode')
            outfile.write(' TypeCode=%s' % (quote_attrib(self.TypeCode), ))
    def exportChildren(self, outfile, level, namespace_='', name_='PremisesType1', fromsubclass_=False, pretty_print=True):
        super(PremisesType1, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for SubPremises_ in self.SubPremises:
            SubPremises_.export(outfile, level, namespace_, name_='SubPremises', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.SubPremises or
            super(PremisesType1, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='PremisesType1'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        if self.TypeCode is not None and 'TypeCode' not in already_processed:
            already_processed.append('TypeCode')
            showIndent(outfile, level)
            outfile.write('TypeCode = %s,\n' % (self.TypeCode,))
        super(PremisesType1, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(PremisesType1, self).exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('SubPremises=[\n')
        level += 1
        for SubPremises_ in self.SubPremises:
            showIndent(outfile, level)
            outfile.write('model_.SubPremisesType(\n')
            SubPremises_.exportLiteral(outfile, level, name_='SubPremisesType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_PremisesTypeList(self.Type)    # validate type PremisesTypeList
        value = find_attr_value_('TypeCode', node)
        if value is not None and 'TypeCode' not in already_processed:
            already_processed.append('TypeCode')
            self.TypeCode = value
        super(PremisesType1, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SubPremises':
            obj_ = SubPremisesType.factory()
            obj_.build(child_)
            self.SubPremises.append(obj_)
        super(PremisesType1, self).buildChildren(child_, node, nodeName_, True)
# end class PremisesType1


class SubPremisesType(PremisesType):
    """Type of code used for sub premises type attribute"""
    subclass = None
    superclass = PremisesType
    def __init__(self, NameElement=None, Number=None, Type=None, TypeCode=None):
        super(SubPremisesType, self).__init__(NameElement, Number, )
        self.Type = _cast(None, Type)
        self.TypeCode = _cast(None, TypeCode)
        pass
    def factory(*args_, **kwargs_):
        if SubPremisesType.subclass:
            return SubPremisesType.subclass(*args_, **kwargs_)
        else:
            return SubPremisesType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_SubPremisesTypeList(self, value):
        # Validate type SubPremisesTypeList, a restriction on xs:normalizedString.
        pass
    def get_TypeCode(self): return self.TypeCode
    def set_TypeCode(self, TypeCode): self.TypeCode = TypeCode
    def export(self, outfile, level, namespace_='', name_='SubPremisesType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='SubPremisesType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SubPremisesType'):
        super(SubPremisesType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SubPremisesType')
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
        if self.TypeCode is not None and 'TypeCode' not in already_processed:
            already_processed.append('TypeCode')
            outfile.write(' TypeCode=%s' % (quote_attrib(self.TypeCode), ))
    def exportChildren(self, outfile, level, namespace_='', name_='SubPremisesType', fromsubclass_=False, pretty_print=True):
        super(SubPremisesType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
    def hasContent_(self):
        if (
            super(SubPremisesType, self).hasContent_()
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='SubPremisesType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        if self.TypeCode is not None and 'TypeCode' not in already_processed:
            already_processed.append('TypeCode')
            showIndent(outfile, level)
            outfile.write('TypeCode = %s,\n' % (self.TypeCode,))
        super(SubPremisesType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(SubPremisesType, self).exportLiteralChildren(outfile, level, name_)
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_SubPremisesTypeList(self.Type)    # validate type SubPremisesTypeList
        value = find_attr_value_('TypeCode', node)
        if value is not None and 'TypeCode' not in already_processed:
            already_processed.append('TypeCode')
            self.TypeCode = value
        super(SubPremisesType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        super(SubPremisesType, self).buildChildren(child_, node, nodeName_, True)
        pass
# end class SubPremisesType


class PostCodeType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, ValidTo=None, ValidFrom=None, DataQualityType=None, Identifier=None):
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.DataQualityType = _cast(None, DataQualityType)
        if Identifier is None:
            self.Identifier = []
        else:
            self.Identifier = Identifier
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if PostCodeType.subclass:
            return PostCodeType.subclass(*args_, **kwargs_)
        else:
            return PostCodeType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Identifier(self): return self.Identifier
    def set_Identifier(self, Identifier): self.Identifier = Identifier
    def add_Identifier(self, value): self.Identifier.append(value)
    def insert_Identifier(self, index, value): self.Identifier[index] = value
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='PostCodeType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='PostCodeType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PostCodeType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
    def exportChildren(self, outfile, level, namespace_='', name_='PostCodeType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for Identifier_ in self.Identifier:
            Identifier_.export(outfile, level, namespace_, name_='Identifier', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Identifier
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='PostCodeType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('Identifier=[\n')
        level += 1
        for Identifier_ in self.Identifier:
            showIndent(outfile, level)
            outfile.write('model_.IdentifierType(\n')
            Identifier_.exportLiteral(outfile, level, name_='IdentifierType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Identifier':
            obj_ = IdentifierType.factory()
            obj_.build(child_)
            self.Identifier.append(obj_)
# end class PostCodeType


class RuralDeliveryType(GeneratedsSuper):
    """Type of rural delivery. For some addresses, delivery to rural areas
    happens via water, air or road"""
    subclass = None
    superclass = None
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, Identifier=None):
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Type = _cast(None, Type)
        if Identifier is None:
            self.Identifier = []
        else:
            self.Identifier = Identifier
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if RuralDeliveryType.subclass:
            return RuralDeliveryType.subclass(*args_, **kwargs_)
        else:
            return RuralDeliveryType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Identifier(self): return self.Identifier
    def set_Identifier(self, Identifier): self.Identifier = Identifier
    def add_Identifier(self, value): self.Identifier.append(value)
    def insert_Identifier(self, index, value): self.Identifier[index] = value
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_RuralDeliveryTypeList(self, value):
        # Validate type RuralDeliveryTypeList, a restriction on xs:normalizedString.
        pass
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='RuralDeliveryType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='RuralDeliveryType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='RuralDeliveryType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
    def exportChildren(self, outfile, level, namespace_='', name_='RuralDeliveryType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for Identifier_ in self.Identifier:
            Identifier_.export(outfile, level, namespace_, name_='Identifier', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Identifier
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='RuralDeliveryType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('Identifier=[\n')
        level += 1
        for Identifier_ in self.Identifier:
            showIndent(outfile, level)
            outfile.write('model_.IdentifierType(\n')
            Identifier_.exportLiteral(outfile, level, name_='IdentifierType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_RuralDeliveryTypeList(self.Type)    # validate type RuralDeliveryTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Identifier':
            obj_ = IdentifierType.factory()
            obj_.build(child_)
            self.Identifier.append(obj_)
# end class RuralDeliveryType


class PostalDeliveryPointType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, Identifier=None):
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Type = _cast(None, Type)
        if Identifier is None:
            self.Identifier = []
        else:
            self.Identifier = Identifier
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if PostalDeliveryPointType.subclass:
            return PostalDeliveryPointType.subclass(*args_, **kwargs_)
        else:
            return PostalDeliveryPointType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Identifier(self): return self.Identifier
    def set_Identifier(self, Identifier): self.Identifier = Identifier
    def add_Identifier(self, value): self.Identifier.append(value)
    def insert_Identifier(self, index, value): self.Identifier[index] = value
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_PostalDeliveryPointTypeList(self, value):
        # Validate type PostalDeliveryPointTypeList, a restriction on xs:normalizedString.
        pass
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='PostalDeliveryPointType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='PostalDeliveryPointType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PostalDeliveryPointType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
    def exportChildren(self, outfile, level, namespace_='', name_='PostalDeliveryPointType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for Identifier_ in self.Identifier:
            Identifier_.export(outfile, level, namespace_, name_='Identifier', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Identifier
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='PostalDeliveryPointType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('Identifier=[\n')
        level += 1
        for Identifier_ in self.Identifier:
            showIndent(outfile, level)
            outfile.write('model_.IdentifierType(\n')
            Identifier_.exportLiteral(outfile, level, name_='IdentifierType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_PostalDeliveryPointTypeList(self.Type)    # validate type PostalDeliveryPointTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Identifier':
            obj_ = IdentifierType.factory()
            obj_.build(child_)
            self.Identifier.append(obj_)
# end class PostalDeliveryPointType


class PostOfficeType(GeneratedsSuper):
    """Indicates the type of postal delivery office from where the mail
    will be distributed to the final delivery point by a delivery
    mode. Example: Post Office, Mail Collection Centre, Letter
    Carrier Depot, Station, etc."""
    subclass = None
    superclass = None
    def __init__(self, DataQualityType=None, ValidTo=None, ValidFrom=None, Type=None, Identifier=None):
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Type = _cast(None, Type)
        if Identifier is None:
            self.Identifier = []
        else:
            self.Identifier = Identifier
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if PostOfficeType.subclass:
            return PostOfficeType.subclass(*args_, **kwargs_)
        else:
            return PostOfficeType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Identifier(self): return self.Identifier
    def set_Identifier(self, Identifier): self.Identifier = Identifier
    def add_Identifier(self, value): self.Identifier.append(value)
    def insert_Identifier(self, index, value): self.Identifier[index] = value
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Type(self): return self.Type
    def set_Type(self, Type): self.Type = Type
    def validate_PostOfficeTypeList(self, value):
        # Validate type PostOfficeTypeList, a restriction on xs:normalizedString.
        pass
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='PostOfficeType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='PostOfficeType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PostOfficeType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            outfile.write(' Type=%s' % (quote_attrib(self.Type), ))
    def exportChildren(self, outfile, level, namespace_='', name_='PostOfficeType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for Identifier_ in self.Identifier:
            Identifier_.export(outfile, level, namespace_, name_='Identifier', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Identifier
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='PostOfficeType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Type is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            showIndent(outfile, level)
            outfile.write('Type = "%s",\n' % (self.Type,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('Identifier=[\n')
        level += 1
        for Identifier_ in self.Identifier:
            showIndent(outfile, level)
            outfile.write('model_.IdentifierType(\n')
            Identifier_.exportLiteral(outfile, level, name_='IdentifierType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Type', node)
        if value is not None and 'Type' not in already_processed:
            already_processed.append('Type')
            self.Type = value
            self.validate_PostOfficeTypeList(self.Type)    # validate type PostOfficeTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Identifier':
            obj_ = IdentifierType.factory()
            obj_.build(child_)
            self.Identifier.append(obj_)
# end class PostOfficeType


class GeoRSSType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, anytypeobjs_=None):
        if anytypeobjs_ is None:
            self.anytypeobjs_ = []
        else:
            self.anytypeobjs_ = anytypeobjs_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if GeoRSSType.subclass:
            return GeoRSSType.subclass(*args_, **kwargs_)
        else:
            return GeoRSSType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_anytypeobjs_(self): return self.anytypeobjs_
    def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_
    def add_anytypeobjs_(self, value): self.anytypeobjs_.append(value)
    def insert_anytypeobjs_(self, index, value): self._anytypeobjs_[index] = value
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='GeoRSSType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='GeoRSSType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='GeoRSSType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='GeoRSSType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for obj_ in self.anytypeobjs_:
            obj_.export(outfile, level, namespace_, pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.anytypeobjs_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='GeoRSSType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('anytypeobjs_=[\n')
        level += 1
        for anytypeobjs_ in self.anytypeobjs_:
            anytypeobjs_.exportLiteral(outfile, level)
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        obj_ = self.gds_build_any(child_, 'GeoRSSType')
        if obj_ is not None:
            self.add_anytypeobjs_(obj_)
# end class GeoRSSType


class LocationByCoordinatesType(GeneratedsSuper):
    """The collection of the coordinate numeric values for latitude amd
    longtitude depends on the agreed position of the meridian.
    Declaration of the meridian is necessary as it cannot be assumed
    in the dataType of code used. e.g. EPSG CodeThe collection of
    the coordinate numeric values depends on the agreed datum within
    which the measurement was taken. Declaration of the datum is
    necessary as it cannot be assumed in the dataType of code used.
    e.g. EPSG Code, WGS-84Coordinates have limited utility and
    application depending on the projection required for
    visualisation in a map. Declaration of projection is necessary
    as it cannot be assumed in dataType of code used. e.g. EPSG Code"""
    subclass = None
    superclass = None
    def __init__(self, Projection=None, MeridianCodeType=None, DatumCodeType=None, Datum=None, DataQualityType=None, ValidTo=None, ValidFrom=None, Meridian=None, ProjectionCodeType=None, Latitude=None, Longitude=None):
        self.Projection = _cast(None, Projection)
        self.MeridianCodeType = _cast(None, MeridianCodeType)
        self.DatumCodeType = _cast(None, DatumCodeType)
        self.Datum = _cast(None, Datum)
        self.DataQualityType = _cast(None, DataQualityType)
        self.ValidTo = _cast(None, ValidTo)
        self.ValidFrom = _cast(None, ValidFrom)
        self.Meridian = _cast(None, Meridian)
        self.ProjectionCodeType = _cast(None, ProjectionCodeType)
        self.Latitude = Latitude
        self.Longitude = Longitude
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if LocationByCoordinatesType.subclass:
            return LocationByCoordinatesType.subclass(*args_, **kwargs_)
        else:
            return LocationByCoordinatesType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Latitude(self): return self.Latitude
    def set_Latitude(self, Latitude): self.Latitude = Latitude
    def get_Longitude(self): return self.Longitude
    def set_Longitude(self, Longitude): self.Longitude = Longitude
    def get_Projection(self): return self.Projection
    def set_Projection(self, Projection): self.Projection = Projection
    def validate_ProjectionCodeList(self, value):
        # Validate type ProjectionCodeList, a restriction on xs:normalizedString.
        pass
    def get_MeridianCodeType(self): return self.MeridianCodeType
    def set_MeridianCodeType(self, MeridianCodeType): self.MeridianCodeType = MeridianCodeType
    def get_DatumCodeType(self): return self.DatumCodeType
    def set_DatumCodeType(self, DatumCodeType): self.DatumCodeType = DatumCodeType
    def get_Datum(self): return self.Datum
    def set_Datum(self, Datum): self.Datum = Datum
    def validate_DatumCodeList(self, value):
        # Validate type DatumCodeList, a restriction on xs:normalizedString.
        pass
    def get_DataQualityType(self): return self.DataQualityType
    def set_DataQualityType(self, DataQualityType): self.DataQualityType = DataQualityType
    def validate_DataQualityTypeList(self, value):
        # Validate type DataQualityTypeList, a restriction on xs:string.
        pass
    def get_ValidTo(self): return self.ValidTo
    def set_ValidTo(self, ValidTo): self.ValidTo = ValidTo
    def get_ValidFrom(self): return self.ValidFrom
    def set_ValidFrom(self, ValidFrom): self.ValidFrom = ValidFrom
    def get_Meridian(self): return self.Meridian
    def set_Meridian(self, Meridian): self.Meridian = Meridian
    def validate_MeridianCodeList(self, value):
        # Validate type MeridianCodeList, a restriction on xs:normalizedString.
        pass
    def get_ProjectionCodeType(self): return self.ProjectionCodeType
    def set_ProjectionCodeType(self, ProjectionCodeType): self.ProjectionCodeType = ProjectionCodeType
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='LocationByCoordinatesType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='LocationByCoordinatesType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LocationByCoordinatesType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Projection is not None and 'Projection' not in already_processed:
            already_processed.append('Projection')
            outfile.write(' Projection=%s' % (quote_attrib(self.Projection), ))
        if self.MeridianCodeType is not None and 'MeridianCodeType' not in already_processed:
            already_processed.append('MeridianCodeType')
            outfile.write(' MeridianCodeType=%s' % (quote_attrib(self.MeridianCodeType), ))
        if self.DatumCodeType is not None and 'DatumCodeType' not in already_processed:
            already_processed.append('DatumCodeType')
            outfile.write(' DatumCodeType=%s' % (quote_attrib(self.DatumCodeType), ))
        if self.Datum is not None and 'Datum' not in already_processed:
            already_processed.append('Datum')
            outfile.write(' Datum=%s' % (quote_attrib(self.Datum), ))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            outfile.write(' DataQualityType=%s' % (quote_attrib(self.DataQualityType), ))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            outfile.write(' ValidTo=%s' % (self.gds_format_string(quote_attrib(self.ValidTo).encode(ExternalEncoding), input_name='ValidTo'), ))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            outfile.write(' ValidFrom=%s' % (self.gds_format_string(quote_attrib(self.ValidFrom).encode(ExternalEncoding), input_name='ValidFrom'), ))
        if self.Meridian is not None and 'Meridian' not in already_processed:
            already_processed.append('Meridian')
            outfile.write(' Meridian=%s' % (quote_attrib(self.Meridian), ))
        if self.ProjectionCodeType is not None and 'ProjectionCodeType' not in already_processed:
            already_processed.append('ProjectionCodeType')
            outfile.write(' ProjectionCodeType=%s' % (quote_attrib(self.ProjectionCodeType), ))
    def exportChildren(self, outfile, level, namespace_='', name_='LocationByCoordinatesType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.Latitude is not None:
            self.Latitude.export(outfile, level, namespace_, name_='Latitude', pretty_print=pretty_print)
        if self.Longitude is not None:
            self.Longitude.export(outfile, level, namespace_, name_='Longitude', pretty_print=pretty_print)
    def hasContent_(self):
        if (
            self.Latitude is not None or
            self.Longitude is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='LocationByCoordinatesType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Projection is not None and 'Projection' not in already_processed:
            already_processed.append('Projection')
            showIndent(outfile, level)
            outfile.write('Projection = "%s",\n' % (self.Projection,))
        if self.MeridianCodeType is not None and 'MeridianCodeType' not in already_processed:
            already_processed.append('MeridianCodeType')
            showIndent(outfile, level)
            outfile.write('MeridianCodeType = %s,\n' % (self.MeridianCodeType,))
        if self.DatumCodeType is not None and 'DatumCodeType' not in already_processed:
            already_processed.append('DatumCodeType')
            showIndent(outfile, level)
            outfile.write('DatumCodeType = %s,\n' % (self.DatumCodeType,))
        if self.Datum is not None and 'Datum' not in already_processed:
            already_processed.append('Datum')
            showIndent(outfile, level)
            outfile.write('Datum = "%s",\n' % (self.Datum,))
        if self.DataQualityType is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            showIndent(outfile, level)
            outfile.write('DataQualityType = "%s",\n' % (self.DataQualityType,))
        if self.ValidTo is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            showIndent(outfile, level)
            outfile.write('ValidTo = "%s",\n' % (self.ValidTo,))
        if self.ValidFrom is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            showIndent(outfile, level)
            outfile.write('ValidFrom = "%s",\n' % (self.ValidFrom,))
        if self.Meridian is not None and 'Meridian' not in already_processed:
            already_processed.append('Meridian')
            showIndent(outfile, level)
            outfile.write('Meridian = "%s",\n' % (self.Meridian,))
        if self.ProjectionCodeType is not None and 'ProjectionCodeType' not in already_processed:
            already_processed.append('ProjectionCodeType')
            showIndent(outfile, level)
            outfile.write('ProjectionCodeType = %s,\n' % (self.ProjectionCodeType,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.Latitude is not None:
            showIndent(outfile, level)
            outfile.write('Latitude=model_.LatitudeType(\n')
            self.Latitude.exportLiteral(outfile, level, name_='Latitude')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.Longitude is not None:
            showIndent(outfile, level)
            outfile.write('Longitude=model_.LongitudeType(\n')
            self.Longitude.exportLiteral(outfile, level, name_='Longitude')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Projection', node)
        if value is not None and 'Projection' not in already_processed:
            already_processed.append('Projection')
            self.Projection = value
            self.validate_ProjectionCodeList(self.Projection)    # validate type ProjectionCodeList
        value = find_attr_value_('MeridianCodeType', node)
        if value is not None and 'MeridianCodeType' not in already_processed:
            already_processed.append('MeridianCodeType')
            self.MeridianCodeType = value
        value = find_attr_value_('DatumCodeType', node)
        if value is not None and 'DatumCodeType' not in already_processed:
            already_processed.append('DatumCodeType')
            self.DatumCodeType = value
        value = find_attr_value_('Datum', node)
        if value is not None and 'Datum' not in already_processed:
            already_processed.append('Datum')
            self.Datum = value
            self.validate_DatumCodeList(self.Datum)    # validate type DatumCodeList
        value = find_attr_value_('DataQualityType', node)
        if value is not None and 'DataQualityType' not in already_processed:
            already_processed.append('DataQualityType')
            self.DataQualityType = value
            self.validate_DataQualityTypeList(self.DataQualityType)    # validate type DataQualityTypeList
        value = find_attr_value_('ValidTo', node)
        if value is not None and 'ValidTo' not in already_processed:
            already_processed.append('ValidTo')
            self.ValidTo = value
        value = find_attr_value_('ValidFrom', node)
        if value is not None and 'ValidFrom' not in already_processed:
            already_processed.append('ValidFrom')
            self.ValidFrom = value
        value = find_attr_value_('Meridian', node)
        if value is not None and 'Meridian' not in already_processed:
            already_processed.append('Meridian')
            self.Meridian = value
            self.validate_MeridianCodeList(self.Meridian)    # validate type MeridianCodeList
        value = find_attr_value_('ProjectionCodeType', node)
        if value is not None and 'ProjectionCodeType' not in already_processed:
            already_processed.append('ProjectionCodeType')
            self.ProjectionCodeType = value
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'Latitude':
            obj_ = LatitudeType.factory()
            obj_.build(child_)
            self.set_Latitude(obj_)
        elif nodeName_ == 'Longitude':
            obj_ = LongitudeType.factory()
            obj_.build(child_)
            self.set_Longitude(obj_)
# end class LocationByCoordinatesType


class LatitudeType(GeneratedsSuper):
    """Measure of the latitude in degreesMeasure of the latitude in
    minutesMeasure of the latitude in secondsThe direction of
    latitude measurement offset from the equator"""
    subclass = None
    superclass = None
    def __init__(self, Direction=None, MinutesMeasure=None, SecondsMeasure=None, DegreesMeasure=None):
        self.Direction = _cast(None, Direction)
        self.MinutesMeasure = _cast(None, MinutesMeasure)
        self.SecondsMeasure = _cast(None, SecondsMeasure)
        self.DegreesMeasure = _cast(None, DegreesMeasure)
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if LatitudeType.subclass:
            return LatitudeType.subclass(*args_, **kwargs_)
        else:
            return LatitudeType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Direction(self): return self.Direction
    def set_Direction(self, Direction): self.Direction = Direction
    def validate_DirectionTypeList(self, value):
        # Validate type DirectionTypeList, a restriction on xs:normalizedString.
        pass
    def get_MinutesMeasure(self): return self.MinutesMeasure
    def set_MinutesMeasure(self, MinutesMeasure): self.MinutesMeasure = MinutesMeasure
    def get_SecondsMeasure(self): return self.SecondsMeasure
    def set_SecondsMeasure(self, SecondsMeasure): self.SecondsMeasure = SecondsMeasure
    def get_DegreesMeasure(self): return self.DegreesMeasure
    def set_DegreesMeasure(self, DegreesMeasure): self.DegreesMeasure = DegreesMeasure
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='LatitudeType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='LatitudeType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LatitudeType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Direction is not None and 'Direction' not in already_processed:
            already_processed.append('Direction')
            outfile.write(' Direction=%s' % (quote_attrib(self.Direction), ))
        if self.MinutesMeasure is not None and 'MinutesMeasure' not in already_processed:
            already_processed.append('MinutesMeasure')
            outfile.write(' MinutesMeasure=%s' % (quote_attrib(self.MinutesMeasure), ))
        if self.SecondsMeasure is not None and 'SecondsMeasure' not in already_processed:
            already_processed.append('SecondsMeasure')
            outfile.write(' SecondsMeasure=%s' % (quote_attrib(self.SecondsMeasure), ))
        if self.DegreesMeasure is not None and 'DegreesMeasure' not in already_processed:
            already_processed.append('DegreesMeasure')
            outfile.write(' DegreesMeasure=%s' % (quote_attrib(self.DegreesMeasure), ))
    def exportChildren(self, outfile, level, namespace_='', name_='LatitudeType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='LatitudeType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Direction is not None and 'Direction' not in already_processed:
            already_processed.append('Direction')
            showIndent(outfile, level)
            outfile.write('Direction = "%s",\n' % (self.Direction,))
        if self.MinutesMeasure is not None and 'MinutesMeasure' not in already_processed:
            already_processed.append('MinutesMeasure')
            showIndent(outfile, level)
            outfile.write('MinutesMeasure = %s,\n' % (self.MinutesMeasure,))
        if self.SecondsMeasure is not None and 'SecondsMeasure' not in already_processed:
            already_processed.append('SecondsMeasure')
            showIndent(outfile, level)
            outfile.write('SecondsMeasure = %s,\n' % (self.SecondsMeasure,))
        if self.DegreesMeasure is not None and 'DegreesMeasure' not in already_processed:
            already_processed.append('DegreesMeasure')
            showIndent(outfile, level)
            outfile.write('DegreesMeasure = %s,\n' % (self.DegreesMeasure,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Direction', node)
        if value is not None and 'Direction' not in already_processed:
            already_processed.append('Direction')
            self.Direction = value
            self.validate_DirectionTypeList(self.Direction)    # validate type DirectionTypeList
        value = find_attr_value_('MinutesMeasure', node)
        if value is not None and 'MinutesMeasure' not in already_processed:
            already_processed.append('MinutesMeasure')
            self.MinutesMeasure = value
        value = find_attr_value_('SecondsMeasure', node)
        if value is not None and 'SecondsMeasure' not in already_processed:
            already_processed.append('SecondsMeasure')
            self.SecondsMeasure = value
        value = find_attr_value_('DegreesMeasure', node)
        if value is not None and 'DegreesMeasure' not in already_processed:
            already_processed.append('DegreesMeasure')
            self.DegreesMeasure = value
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class LatitudeType


class LongitudeType(GeneratedsSuper):
    """Measure of the longitude in degreesMeasure of the longitude in
    minutesMeasure of the longitude in secondsThe direction of
    longitude measurement offset from the equator"""
    subclass = None
    superclass = None
    def __init__(self, Direction=None, MinutesMeasure=None, SecondsMeasure=None, DegreesMeasure=None):
        self.Direction = _cast(None, Direction)
        self.MinutesMeasure = _cast(None, MinutesMeasure)
        self.SecondsMeasure = _cast(None, SecondsMeasure)
        self.DegreesMeasure = _cast(None, DegreesMeasure)
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if LongitudeType.subclass:
            return LongitudeType.subclass(*args_, **kwargs_)
        else:
            return LongitudeType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Direction(self): return self.Direction
    def set_Direction(self, Direction): self.Direction = Direction
    def validate_DirectionTypeList(self, value):
        # Validate type DirectionTypeList, a restriction on xs:normalizedString.
        pass
    def get_MinutesMeasure(self): return self.MinutesMeasure
    def set_MinutesMeasure(self, MinutesMeasure): self.MinutesMeasure = MinutesMeasure
    def get_SecondsMeasure(self): return self.SecondsMeasure
    def set_SecondsMeasure(self, SecondsMeasure): self.SecondsMeasure = SecondsMeasure
    def get_DegreesMeasure(self): return self.DegreesMeasure
    def set_DegreesMeasure(self, DegreesMeasure): self.DegreesMeasure = DegreesMeasure
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='LongitudeType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='LongitudeType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='LongitudeType'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Direction is not None and 'Direction' not in already_processed:
            already_processed.append('Direction')
            outfile.write(' Direction=%s' % (quote_attrib(self.Direction), ))
        if self.MinutesMeasure is not None and 'MinutesMeasure' not in already_processed:
            already_processed.append('MinutesMeasure')
            outfile.write(' MinutesMeasure=%s' % (quote_attrib(self.MinutesMeasure), ))
        if self.SecondsMeasure is not None and 'SecondsMeasure' not in already_processed:
            already_processed.append('SecondsMeasure')
            outfile.write(' SecondsMeasure=%s' % (quote_attrib(self.SecondsMeasure), ))
        if self.DegreesMeasure is not None and 'DegreesMeasure' not in already_processed:
            already_processed.append('DegreesMeasure')
            outfile.write(' DegreesMeasure=%s' % (quote_attrib(self.DegreesMeasure), ))
    def exportChildren(self, outfile, level, namespace_='', name_='LongitudeType', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (

            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='LongitudeType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Direction is not None and 'Direction' not in already_processed:
            already_processed.append('Direction')
            showIndent(outfile, level)
            outfile.write('Direction = "%s",\n' % (self.Direction,))
        if self.MinutesMeasure is not None and 'MinutesMeasure' not in already_processed:
            already_processed.append('MinutesMeasure')
            showIndent(outfile, level)
            outfile.write('MinutesMeasure = %s,\n' % (self.MinutesMeasure,))
        if self.SecondsMeasure is not None and 'SecondsMeasure' not in already_processed:
            already_processed.append('SecondsMeasure')
            showIndent(outfile, level)
            outfile.write('SecondsMeasure = %s,\n' % (self.SecondsMeasure,))
        if self.DegreesMeasure is not None and 'DegreesMeasure' not in already_processed:
            already_processed.append('DegreesMeasure')
            showIndent(outfile, level)
            outfile.write('DegreesMeasure = %s,\n' % (self.DegreesMeasure,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Direction', node)
        if value is not None and 'Direction' not in already_processed:
            already_processed.append('Direction')
            self.Direction = value
            self.validate_DirectionTypeList(self.Direction)    # validate type DirectionTypeList
        value = find_attr_value_('MinutesMeasure', node)
        if value is not None and 'MinutesMeasure' not in already_processed:
            already_processed.append('MinutesMeasure')
            self.MinutesMeasure = value
        value = find_attr_value_('SecondsMeasure', node)
        if value is not None and 'SecondsMeasure' not in already_processed:
            already_processed.append('SecondsMeasure')
            self.SecondsMeasure = value
        value = find_attr_value_('DegreesMeasure', node)
        if value is not None and 'DegreesMeasure' not in already_processed:
            already_processed.append('DegreesMeasure')
            self.DegreesMeasure = value
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class LongitudeType


class NameElementType4(GeneratedsSuper):
    """Semantics of data associated with name. Name of the country
    represented as a codeType of code used to represent name of
    country, e.g. iso-3166"""
    subclass = None
    superclass = None
    def __init__(self, Abbreviation=None, NameType=None, NameCodeType=None, NameCode=None, valueOf_=None):
        self.Abbreviation = _cast(bool, Abbreviation)
        self.NameType = _cast(None, NameType)
        self.NameCodeType = _cast(None, NameCodeType)
        self.NameCode = _cast(None, NameCode)
        self.valueOf_ = valueOf_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if NameElementType4.subclass:
            return NameElementType4.subclass(*args_, **kwargs_)
        else:
            return NameElementType4(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Abbreviation(self): return self.Abbreviation
    def set_Abbreviation(self, Abbreviation): self.Abbreviation = Abbreviation
    def get_NameType(self): return self.NameType
    def set_NameType(self, NameType): self.NameType = NameType
    def validate_CountryNameTypeList(self, value):
        # Validate type CountryNameTypeList, a restriction on xs:normalizedString.
        pass
    def get_NameCodeType(self): return self.NameCodeType
    def set_NameCodeType(self, NameCodeType): self.NameCodeType = NameCodeType
    def get_NameCode(self): return self.NameCode
    def set_NameCode(self, NameCode): self.NameCode = NameCode
    def validate_CountryNameCodeList(self, value):
        # Validate type CountryNameCodeList, a restriction on xs:normalizedString.
        pass
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='NameElementType4', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='NameElementType4')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='NameElementType4'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            outfile.write(' Abbreviation="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.Abbreviation)), input_name='Abbreviation'))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            outfile.write(' NameType=%s' % (quote_attrib(self.NameType), ))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            outfile.write(' NameCodeType=%s' % (quote_attrib(self.NameCodeType), ))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            outfile.write(' NameCode=%s' % (quote_attrib(self.NameCode), ))
    def exportChildren(self, outfile, level, namespace_='', name_='NameElementType4', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='NameElementType4'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            showIndent(outfile, level)
            outfile.write('Abbreviation = %s,\n' % (self.Abbreviation,))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            showIndent(outfile, level)
            outfile.write('NameType = "%s",\n' % (self.NameType,))
        if self.NameCodeType is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            showIndent(outfile, level)
            outfile.write('NameCodeType = %s,\n' % (self.NameCodeType,))
        if self.NameCode is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            showIndent(outfile, level)
            outfile.write('NameCode = "%s",\n' % (self.NameCode,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Abbreviation', node)
        if value is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            if value in ('true', '1'):
                self.Abbreviation = True
            elif value in ('false', '0'):
                self.Abbreviation = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('NameType', node)
        if value is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            self.NameType = value
            self.validate_CountryNameTypeList(self.NameType)    # validate type CountryNameTypeList
        value = find_attr_value_('NameCodeType', node)
        if value is not None and 'NameCodeType' not in already_processed:
            already_processed.append('NameCodeType')
            self.NameCodeType = value
        value = find_attr_value_('NameCode', node)
        if value is not None and 'NameCode' not in already_processed:
            already_processed.append('NameCode')
            self.NameCode = value
            self.validate_CountryNameCodeList(self.NameCode)    # validate type CountryNameCodeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class NameElementType4


class NameElementType5(GeneratedsSuper):
    """Describes the type / part of name this element contains."""
    subclass = None
    superclass = None
    def __init__(self, Abbreviation=None, NameType=None, valueOf_=None):
        self.Abbreviation = _cast(bool, Abbreviation)
        self.NameType = _cast(None, NameType)
        self.valueOf_ = valueOf_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if NameElementType5.subclass:
            return NameElementType5.subclass(*args_, **kwargs_)
        else:
            return NameElementType5(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Abbreviation(self): return self.Abbreviation
    def set_Abbreviation(self, Abbreviation): self.Abbreviation = Abbreviation
    def get_NameType(self): return self.NameType
    def set_NameType(self, NameType): self.NameType = NameType
    def validate_PremisesElementTypeList(self, value):
        # Validate type PremisesElementTypeList, a restriction on xs:normalizedString.
        pass
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='NameElementType5', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='NameElementType5')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='NameElementType5'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            outfile.write(' Abbreviation="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.Abbreviation)), input_name='Abbreviation'))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            outfile.write(' NameType=%s' % (quote_attrib(self.NameType), ))
    def exportChildren(self, outfile, level, namespace_='', name_='NameElementType5', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='NameElementType5'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            showIndent(outfile, level)
            outfile.write('Abbreviation = %s,\n' % (self.Abbreviation,))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            showIndent(outfile, level)
            outfile.write('NameType = "%s",\n' % (self.NameType,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Abbreviation', node)
        if value is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            if value in ('true', '1'):
                self.Abbreviation = True
            elif value in ('false', '0'):
                self.Abbreviation = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('NameType', node)
        if value is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            self.NameType = value
            self.validate_PremisesElementTypeList(self.NameType)    # validate type PremisesElementTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class NameElementType5


class NameElementType6(GeneratedsSuper):
    """Describes the type / part of name this element contains."""
    subclass = None
    superclass = None
    def __init__(self, Abbreviation=None, NameType=None, valueOf_=None):
        self.Abbreviation = _cast(bool, Abbreviation)
        self.NameType = _cast(None, NameType)
        self.valueOf_ = valueOf_
        self.anyAttributes_ = {}
    def factory(*args_, **kwargs_):
        if NameElementType6.subclass:
            return NameElementType6.subclass(*args_, **kwargs_)
        else:
            return NameElementType6(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Abbreviation(self): return self.Abbreviation
    def set_Abbreviation(self, Abbreviation): self.Abbreviation = Abbreviation
    def get_NameType(self): return self.NameType
    def set_NameType(self, NameType): self.NameType = NameType
    def validate_ThoroughfareNameTypeList(self, value):
        # Validate type ThoroughfareNameTypeList, a restriction on xs:normalizedString.
        pass
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_anyAttributes_(self): return self.anyAttributes_
    def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
    def export(self, outfile, level, namespace_='', name_='NameElementType6', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        showIndent(outfile, level, pretty_print)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='NameElementType6')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='NameElementType6'):
        unique_counter = 0
        for name, value in self.anyAttributes_.items():
            xsinamespaceprefix = 'xsi'
            xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
            xsinamespace2 = '{%s}' % (xsinamespace1, )
            if name.startswith(xsinamespace2):
                name1 = name[len(xsinamespace2):]
                name2 = '%s:%s' % (xsinamespaceprefix, name1, )
                if name2 not in already_processed:
                    already_processed.append(name2)
                    outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
            else:
                mo = re_.match(Namespace_extract_pat_, name)
                if mo is not None:
                    namespace, name = mo.group(1, 2)
                    if name not in already_processed:
                        already_processed.append(name)
                        if namespace == 'http://www.w3.org/XML/1998/namespace':
                            outfile.write(' %s=%s' % (name, quote_attrib(value), ))
                        else:
                            unique_counter += 1
                            outfile.write(' xmlns:yyy%d="%s"' % (unique_counter, namespace, ))
                            outfile.write(' yyy%d:%s=%s' % (unique_counter, name, quote_attrib(value), ))
                else:
                    if name not in already_processed:
                        already_processed.append(name)
                        outfile.write(' %s=%s' % (name, quote_attrib(value), ))
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            outfile.write(' Abbreviation="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.Abbreviation)), input_name='Abbreviation'))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            outfile.write(' NameType=%s' % (quote_attrib(self.NameType), ))
    def exportChildren(self, outfile, level, namespace_='', name_='NameElementType6', fromsubclass_=False, pretty_print=True):
        pass
    def hasContent_(self):
        if (
            self.valueOf_
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='NameElementType6'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
        showIndent(outfile, level)
        outfile.write('valueOf_ = """%s""",\n' % (self.valueOf_,))
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.Abbreviation is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            showIndent(outfile, level)
            outfile.write('Abbreviation = %s,\n' % (self.Abbreviation,))
        if self.NameType is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            showIndent(outfile, level)
            outfile.write('NameType = "%s",\n' % (self.NameType,))
        for name, value in self.anyAttributes_.items():
            showIndent(outfile, level)
            outfile.write('%s = "%s",\n' % (name, value,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        self.valueOf_ = get_all_text_(node)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Abbreviation', node)
        if value is not None and 'Abbreviation' not in already_processed:
            already_processed.append('Abbreviation')
            if value in ('true', '1'):
                self.Abbreviation = True
            elif value in ('false', '0'):
                self.Abbreviation = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('NameType', node)
        if value is not None and 'NameType' not in already_processed:
            already_processed.append('NameType')
            self.NameType = value
            self.validate_ThoroughfareNameTypeList(self.NameType)    # validate type ThoroughfareNameTypeList
        self.anyAttributes_ = {}
        for name, value in attrs.items():
            if name not in already_processed:
                self.anyAttributes_[name] = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class NameElementType6


USAGE_TEXT = """
Usage: python <Parser>.py [ -s ] <in_xml_file>
"""

def usage():
    print(USAGE_TEXT)
    sys.exit(1)


def get_root_tag(node):
    tag = Tag_pattern_.match(node.tag).groups()[-1]
    rootClass = globals().get(tag)
    return tag, rootClass


def parse(inFileName):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'Address'
        rootClass = AddressType
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    sys.stdout.write('<?xml version="1.0" ?>\n')
    rootObj.export(sys.stdout, 0, name_=rootTag,
        namespacedef_='',
        pretty_print=True)
    return rootObj


def parseString(inString):
    from StringIO import StringIO
    doc = parsexml_(StringIO(inString))
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'Address'
        rootClass = AddressType
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    sys.stdout.write('<?xml version="1.0" ?>\n')
    rootObj.export(sys.stdout, 0, name_="Address",
        namespacedef_='')
    return rootObj


def parseLiteral(inFileName):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'Address'
        rootClass = AddressType
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    sys.stdout.write('#from xal import *\n\n')
    sys.stdout.write('import stix.bindings.oasis.xal as xal_binding as model_\n\n')
    sys.stdout.write('rootObj = model_.rootTag(\n')
    rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
    sys.stdout.write(')\n')
    return rootObj


def main():
    args = sys.argv[1:]
    if len(args) == 1:
        parse(args[0])
    else:
        usage()


if __name__ == '__main__':
    #import pdb; pdb.set_trace()
    main()


__all__ = [
    "AddressLineType",
    "AddressType",
    "AdministrativeAreaType",
    "CountryType",
    "CountryType1",
    "FreeTextAddressType",
    "GeoRSSType",
    "IdentifierType",
    "LatitudeType",
    "LocalityType",
    "LocationByCoordinatesType",
    "LongitudeType",
    "NameElementType",
    "NameElementType1",
    "NameElementType2",
    "NameElementType3",
    "NameElementType4",
    "NameElementType5",
    "NameElementType6",
    "PostCodeType",
    "PostOfficeType",
    "PostalDeliveryPointType",
    "PremisesType",
    "PremisesType1",
    "RuralDeliveryType",
    "SubAdministrativeAreaType",
    "SubLocalityType",
    "SubPremisesType",
    "SubThoroughfareType",
    "ThoroughfareType",
    "ThoroughfareType1"
    ]
