text:
import sys
import getopt
import re as re_
import base64
import datetime as datetime_

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):
        tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$')
        class _FixedOffsetTZ(datetime_.tzinfo):
            def __init__(self, offset, name):
                self.__offset = datetime_.timedelta(minutes=offset)
                self.__name = name
            def utcoffset(self, dt):
                return self.__offset
            def tzname(self, dt):
                return self.__name
            def dst(self, dt):
                return None
        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_base64(self, input_data, input_name=''):
            return base64.b64encode(input_data)
        def gds_validate_base64(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:
                    float(value)
                except (TypeError, ValueError):
                    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:
                    float(value)
                except (TypeError, ValueError):
                    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:
                    float(value)
                except (TypeError, ValueError):
                    raise_parse_error(node, 'Requires sequence of doubles')
            return input_data
        def gds_format_boolean(self, input_data, input_name=''):
            return ('%s' % input_data).lower()
        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_validate_datetime(self, input_data, node, input_name=''):
            return input_data
        def gds_format_datetime(self, input_data, input_name=''):
            if input_data.microsecond == 0:
                _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (
                    input_data.year,
                    input_data.month,
                    input_data.day,
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                )
            else:
                _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (
                    input_data.year,
                    input_data.month,
                    input_data.day,
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                    ('%f' % (float(input_data.microsecond) / 1000000))[2:],
                )
            if input_data.tzinfo is not None:
                tzoff = input_data.tzinfo.utcoffset(input_data)
                if tzoff is not None:
                    total_seconds = tzoff.seconds + (86400 * tzoff.days)
                    if total_seconds == 0:
                        _svalue += 'Z'
                    else:
                        if total_seconds < 0:
                            _svalue += '-'
                            total_seconds *= -1
                        else:
                            _svalue += '+'
                        hours = total_seconds // 3600
                        minutes = (total_seconds - (hours * 3600)) // 60
                        _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
            return _svalue
        @classmethod
        def gds_parse_datetime(cls, input_data):
            tz = None
            if input_data[-1] == 'Z':
                tz = GeneratedsSuper._FixedOffsetTZ(0, 'GMT')
                input_data = input_data[:-1]
            else:
                results = GeneratedsSuper.tzoff_pattern.search(input_data)
                if results is not None:
                    tzoff_parts = results.group(2).split(':')
                    tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
                    if results.group(1) == '-':
                        tzoff *= -1
                    tz = GeneratedsSuper._FixedOffsetTZ(
                        tzoff, results.group(0))
                    input_data = input_data[:-6]
            if len(input_data.split('.')) > 1:
                dt = datetime_.datetime.strptime(
                    input_data, '%Y-%m-%dT%H:%M:%S.%f')
            else:
                dt = datetime_.datetime.strptime(
                    input_data, '%Y-%m-%dT%H:%M:%S')
            dt = dt.replace(tzinfo=tz)
            return dt
        def gds_validate_date(self, input_data, node, input_name=''):
            return input_data
        def gds_format_date(self, input_data, input_name=''):
            _svalue = '%04d-%02d-%02d' % (
                input_data.year,
                input_data.month,
                input_data.day,
            )
            try:
                if input_data.tzinfo is not None:
                    tzoff = input_data.tzinfo.utcoffset(input_data)
                    if tzoff is not None:
                        total_seconds = tzoff.seconds + (86400 * tzoff.days)
                        if total_seconds == 0:
                            _svalue += 'Z'
                        else:
                            if total_seconds < 0:
                                _svalue += '-'
                                total_seconds *= -1
                            else:
                                _svalue += '+'
                            hours = total_seconds // 3600
                            minutes = (total_seconds - (hours * 3600)) // 60
                            _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
            except AttributeError:
                pass
            return _svalue
        @classmethod
        def gds_parse_date(cls, input_data):
            tz = None
            if input_data[-1] == 'Z':
                tz = GeneratedsSuper._FixedOffsetTZ(0, 'GMT')
                input_data = input_data[:-1]
            else:
                results = GeneratedsSuper.tzoff_pattern.search(input_data)
                if results is not None:
                    tzoff_parts = results.group(2).split(':')
                    tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
                    if results.group(1) == '-':
                        tzoff *= -1
                    tz = GeneratedsSuper._FixedOffsetTZ(
                        tzoff, results.group(0))
                    input_data = input_data[:-6]
            dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')
            dt = dt.replace(tzinfo=tz)
            return dt.date()
        def gds_validate_time(self, input_data, node, input_name=''):
            return input_data
        def gds_format_time(self, input_data, input_name=''):
            if input_data.microsecond == 0:
                _svalue = '%02d:%02d:%02d' % (
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                )
            else:
                _svalue = '%02d:%02d:%02d.%s' % (
                    input_data.hour,
                    input_data.minute,
                    input_data.second,
                    ('%f' % (float(input_data.microsecond) / 1000000))[2:],
                )
            if input_data.tzinfo is not None:
                tzoff = input_data.tzinfo.utcoffset(input_data)
                if tzoff is not None:
                    total_seconds = tzoff.seconds + (86400 * tzoff.days)
                    if total_seconds == 0:
                        _svalue += 'Z'
                    else:
                        if total_seconds < 0:
                            _svalue += '-'
                            total_seconds *= -1
                        else:
                            _svalue += '+'
                        hours = total_seconds // 3600
                        minutes = (total_seconds - (hours * 3600)) // 60
                        _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
            return _svalue
        @classmethod
        def gds_parse_time(cls, input_data):
            tz = None
            if input_data[-1] == 'Z':
                tz = GeneratedsSuper._FixedOffsetTZ(0, 'GMT')
                input_data = input_data[:-1]
            else:
                results = GeneratedsSuper.tzoff_pattern.search(input_data)
                if results is not None:
                    tzoff_parts = results.group(2).split(':')
                    tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
                    if results.group(1) == '-':
                        tzoff *= -1
                    tz = GeneratedsSuper._FixedOffsetTZ(
                        tzoff, results.group(0))
                    input_data = input_data[:-6]
            if len(input_data.split('.')) > 1:
                dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')
            else:
                dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')
            dt = dt.replace(tzinfo=tz)
            return dt.time()
        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
        @classmethod
        def gds_reverse_node_mapping(cls, mapping):
            return dict(((v, k) for k, v in mapping.iteritems()))

#
# 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('&', '&')
    s1 = s1.replace('<', '<')
    s1 = s1.replace('>', '>')
    return s1

def quote_attrib(inStr):
    s1 = (isinstance(inStr, basestring) and inStr or
          '%s' % inStr)
    s1 = s1.replace('&', '&')
    s1 = s1.replace('<', '<')
    s1 = s1.replace('>', '>')
    if '"' in s1:
        if "'" in s1:
            s1 = '"%s"' % s1.replace('"', """)
        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
    TypeBase64 = 8
    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))
        elif self.content_type == MixedContainer.TypeBase64:
            outfile.write('<%s>%s</%s>' % (
                self.name, base64.b64encode(self.value), self.name))
    def to_etree(self, element):
        if self.category == MixedContainer.CategoryText:
            # Prevent exporting empty content as empty lines.
            if self.value.strip():
                if len(element) > 0:
                    if element[-1].tail is None:
                        element[-1].tail = self.value
                    else:
                        element[-1].tail += self.value
                else:
                    if element.text is None:
                        element.text = self.value
                    else:
                        element.text += self.value
        elif self.category == MixedContainer.CategorySimple:
            subelement = etree_.SubElement(element, '%s' % self.name)
            subelement.text = self.to_etree_simple()
        else:    # category == MixedContainer.CategoryComplex
            self.value.to_etree(element)
    def to_etree_simple(self):
        if self.content_type == MixedContainer.TypeString:
            text = self.value
        elif (self.content_type == MixedContainer.TypeInteger or
                self.content_type == MixedContainer.TypeBoolean):
            text = '%d' % self.value
        elif (self.content_type == MixedContainer.TypeFloat or
                self.content_type == MixedContainer.TypeDecimal):
            text = '%f' % self.value
        elif self.content_type == MixedContainer.TypeDouble:
            text = '%g' % self.value
        elif self.content_type == MixedContainer.TypeBase64:
            text = '%s' % base64.b64encode(self.value)
        return text
    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 org(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, termsOfUse=None, registrationDate=None, ref=None, asns=None, city=None, iso3166_1=None, handle=None, name=None, pocs=None, postalCode=None, comment=None, iso3166_2=None, streetAddress=None, updateDate=None, nets=None, anytypeobjs_=None):
        self.termsOfUse = _cast(None, termsOfUse)
        if isinstance(registrationDate, basestring):
            initvalue_ = datetime_.datetime.strptime(registrationDate, '%Y-%m-%dT%H:%M:%S')
        else:
            initvalue_ = registrationDate
        self.registrationDate = initvalue_
        self.ref = ref
        self.asns = asns
        self.city = city
        self.iso3166_1 = iso3166_1
        self.handle = handle
        self.name = name
        self.pocs = pocs
        self.postalCode = postalCode
        self.comment = comment
        self.iso3166_2 = iso3166_2
        self.streetAddress = streetAddress
        if isinstance(updateDate, basestring):
            initvalue_ = datetime_.datetime.strptime(updateDate, '%Y-%m-%dT%H:%M:%S')
        else:
            initvalue_ = updateDate
        self.updateDate = initvalue_
        self.nets = nets
        self.anytypeobjs_ = anytypeobjs_
    def factory(*args_, **kwargs_):
        if org.subclass:
            return org.subclass(*args_, **kwargs_)
        else:
            return org(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_registrationDate(self): return self.registrationDate
    def set_registrationDate(self, registrationDate): self.registrationDate = registrationDate
    def get_ref(self): return self.ref
    def set_ref(self, ref): self.ref = ref
    def get_asns(self): return self.asns
    def set_asns(self, asns): self.asns = asns
    def get_city(self): return self.city
    def set_city(self, city): self.city = city
    def get_iso3166_1(self): return self.iso3166_1
    def set_iso3166_1(self, iso3166_1): self.iso3166_1 = iso3166_1
    def get_handle(self): return self.handle
    def set_handle(self, handle): self.handle = handle
    def get_name(self): return self.name
    def set_name(self, name): self.name = name
    def get_pocs(self): return self.pocs
    def set_pocs(self, pocs): self.pocs = pocs
    def get_postalCode(self): return self.postalCode
    def set_postalCode(self, postalCode): self.postalCode = postalCode
    def get_comment(self): return self.comment
    def set_comment(self, comment): self.comment = comment
    def get_iso3166_2(self): return self.iso3166_2
    def set_iso3166_2(self, iso3166_2): self.iso3166_2 = iso3166_2
    def get_streetAddress(self): return self.streetAddress
    def set_streetAddress(self, streetAddress): self.streetAddress = streetAddress
    def get_updateDate(self): return self.updateDate
    def set_updateDate(self, updateDate): self.updateDate = updateDate
    def get_nets(self): return self.nets
    def set_nets(self, nets): self.nets = nets
    def get_anytypeobjs_(self): return self.anytypeobjs_
    def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_
    def get_termsOfUse(self): return self.termsOfUse
    def set_termsOfUse(self, termsOfUse): self.termsOfUse = termsOfUse
    def hasContent_(self):
        if (
            self.registrationDate is not None or
            self.ref is not None or
            self.asns is not None or
            self.city is not None or
            self.iso3166_1 is not None or
            self.handle is not None or
            self.name is not None or
            self.pocs is not None or
            self.postalCode is not None or
            self.comment is not None or
            self.iso3166_2 is not None or
            self.streetAddress is not None or
            self.updateDate is not None or
            self.nets is not None or
            self.anytypeobjs_ is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='org', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='org')
        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_='v1:', name_='org'):
        if self.termsOfUse is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            outfile.write(' termsOfUse=%s' % (self.gds_format_string(quote_attrib(self.termsOfUse).encode(ExternalEncoding), input_name='termsOfUse'), ))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='org', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.registrationDate is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sregistrationDate>%s</%sregistrationDate>%s' % (namespace_, self.gds_format_datetime(self.registrationDate, input_name='registrationDate'), namespace_, eol_))
        if self.ref is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sref>%s</%sref>%s' % (namespace_, self.gds_format_string(quote_xml(self.ref).encode(ExternalEncoding), input_name='ref'), namespace_, eol_))
        if self.asns is not None:
            self.asns.export(outfile, level, namespace_, name_='asns', pretty_print=pretty_print)
        if self.city is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%scity>%s</%scity>%s' % (namespace_, self.gds_format_string(quote_xml(self.city).encode(ExternalEncoding), input_name='city'), namespace_, eol_))
        if self.iso3166_1 is not None:
            self.iso3166_1.export(outfile, level, namespace_, name_='iso3166-1', pretty_print=pretty_print)
        if self.handle is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%shandle>%s</%shandle>%s' % (namespace_, self.gds_format_string(quote_xml(self.handle).encode(ExternalEncoding), input_name='handle'), namespace_, eol_))
        if self.name is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_))
        if self.pocs is not None:
            self.pocs.export(outfile, level, namespace_, name_='pocs', pretty_print=pretty_print)
        if self.postalCode is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%spostalCode>%s</%spostalCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.postalCode).encode(ExternalEncoding), input_name='postalCode'), namespace_, eol_))
        if self.comment is not None:
            self.comment.export(outfile, level, namespace_, name_='comment', pretty_print=pretty_print)
        if self.iso3166_2 is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%siso3166-2>%s</%siso3166-2>%s' % (namespace_, self.gds_format_string(quote_xml(self.iso3166_2).encode(ExternalEncoding), input_name='iso3166-2'), namespace_, eol_))
        if self.streetAddress is not None:
            self.streetAddress.export(outfile, level, namespace_, name_='streetAddress', pretty_print=pretty_print)
        if self.updateDate is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%supdateDate>%s</%supdateDate>%s' % (namespace_, self.gds_format_datetime(self.updateDate, input_name='updateDate'), namespace_, eol_))
        if self.nets is not None:
            self.nets.export(outfile, level, namespace_, name_='nets', pretty_print=pretty_print)
        if self.anytypeobjs_ is not None:
            self.anytypeobjs_.export(outfile, level, namespace_, pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='org'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.termsOfUse is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            showIndent(outfile, level)
            outfile.write('termsOfUse="%s",\n' % (self.termsOfUse,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.registrationDate is not None:
            showIndent(outfile, level)
            outfile.write('registrationDate=model_.GeneratedsSuper.gds_parse_datetime("%s"),\n' % self.gds_format_datetime(self.registrationDate, input_name='registrationDate'))
        if self.ref is not None:
            showIndent(outfile, level)
            outfile.write('ref=%s,\n' % quote_python(self.ref).encode(ExternalEncoding))
        if self.asns is not None:
            showIndent(outfile, level)
            outfile.write('asns=model_.asns(\n')
            self.asns.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.city is not None:
            showIndent(outfile, level)
            outfile.write('city=%s,\n' % quote_python(self.city).encode(ExternalEncoding))
        if self.iso3166_1 is not None:
            showIndent(outfile, level)
            outfile.write('iso3166_1=model_.iso3166_1(\n')
            self.iso3166_1.exportLiteral(outfile, level, name_='iso3166_1')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.handle is not None:
            showIndent(outfile, level)
            outfile.write('handle=%s,\n' % quote_python(self.handle).encode(ExternalEncoding))
        if self.name is not None:
            showIndent(outfile, level)
            outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
        if self.pocs is not None:
            showIndent(outfile, level)
            outfile.write('pocs=model_.pocs(\n')
            self.pocs.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.postalCode is not None:
            showIndent(outfile, level)
            outfile.write('postalCode=%s,\n' % quote_python(self.postalCode).encode(ExternalEncoding))
        if self.comment is not None:
            showIndent(outfile, level)
            outfile.write('comment=model_.comment(\n')
            self.comment.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.iso3166_2 is not None:
            showIndent(outfile, level)
            outfile.write('iso3166_2=%s,\n' % quote_python(self.iso3166_2).encode(ExternalEncoding))
        if self.streetAddress is not None:
            showIndent(outfile, level)
            outfile.write('streetAddress=model_.streetAddress(\n')
            self.streetAddress.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.updateDate is not None:
            showIndent(outfile, level)
            outfile.write('updateDate=model_.GeneratedsSuper.gds_parse_datetime("%s"),\n' % self.gds_format_datetime(self.updateDate, input_name='updateDate'))
        if self.nets is not None:
            showIndent(outfile, level)
            outfile.write('nets=model_.nets(\n')
            self.nets.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.anytypeobjs_ is not None:
            showIndent(outfile, level)
            outfile.write('anytypeobjs_=model_.anytypeobjs_(\n')
            self.anytypeobjs_.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        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_('termsOfUse', node)
        if value is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            self.termsOfUse = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'registrationDate':
            sval_ = child_.text
            dval_ = self.gds_parse_datetime(sval_)
            self.registrationDate = dval_
        elif nodeName_ == 'ref':
            ref_ = child_.text
            ref_ = self.gds_validate_string(ref_, node, 'ref')
            self.ref = ref_
        elif nodeName_ == 'asns':
            obj_ = asns.factory()
            obj_.build(child_)
            self.set_asns(obj_)
        elif nodeName_ == 'city':
            city_ = child_.text
            city_ = self.gds_validate_string(city_, node, 'city')
            self.city = city_
        elif nodeName_ == 'iso3166-1':
            obj_ = iso3166_1.factory()
            obj_.build(child_)
            self.set_iso3166_1(obj_)
        elif nodeName_ == 'handle':
            handle_ = child_.text
            handle_ = self.gds_validate_string(handle_, node, 'handle')
            self.handle = handle_
        elif nodeName_ == 'name':
            name_ = child_.text
            name_ = self.gds_validate_string(name_, node, 'name')
            self.name = name_
        elif nodeName_ == 'pocs':
            obj_ = pocs.factory()
            obj_.build(child_)
            self.set_pocs(obj_)
        elif nodeName_ == 'postalCode':
            postalCode_ = child_.text
            postalCode_ = self.gds_validate_string(postalCode_, node, 'postalCode')
            self.postalCode = postalCode_
        elif nodeName_ == 'comment':
            obj_ = comment.factory()
            obj_.build(child_)
            self.set_comment(obj_)
        elif nodeName_ == 'iso3166-2':
            iso3166_2_ = child_.text
            iso3166_2_ = self.gds_validate_string(iso3166_2_, node, 'iso3166_2')
            self.iso3166_2 = iso3166_2_
        elif nodeName_ == 'streetAddress':
            obj_ = streetAddress.factory()
            obj_.build(child_)
            self.set_streetAddress(obj_)
        elif nodeName_ == 'updateDate':
            sval_ = child_.text
            dval_ = self.gds_parse_datetime(sval_)
            self.updateDate = dval_
        elif nodeName_ == 'nets':
            obj_ = nets.factory()
            obj_.build(child_)
            self.set_nets(obj_)
        else:
            obj_ = self.gds_build_any(child_, 'org')
            if obj_ is not None:
                self.set_anytypeobjs_(obj_)
# end class org

class asns(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, termsOfUse=None, limitExceeded=None, asnRef=None, anytypeobjs_=None):
        self.termsOfUse = _cast(None, termsOfUse)
        self.limitExceeded = limitExceeded
        self.asnRef = asnRef
        self.anytypeobjs_ = anytypeobjs_
    def factory(*args_, **kwargs_):
        if asns.subclass:
            return asns.subclass(*args_, **kwargs_)
        else:
            return asns(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_limitExceeded(self): return self.limitExceeded
    def set_limitExceeded(self, limitExceeded): self.limitExceeded = limitExceeded
    def get_asnRef(self): return self.asnRef
    def set_asnRef(self, asnRef): self.asnRef = asnRef
    def get_anytypeobjs_(self): return self.anytypeobjs_
    def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_
    def get_termsOfUse(self): return self.termsOfUse
    def set_termsOfUse(self, termsOfUse): self.termsOfUse = termsOfUse
    def hasContent_(self):
        if (
            self.limitExceeded is not None or
            self.asnRef is not None or
            self.anytypeobjs_ is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='asns', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='asns')
        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_='v1:', name_='asns'):
        if self.termsOfUse is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            outfile.write(' termsOfUse=%s' % (self.gds_format_string(quote_attrib(self.termsOfUse).encode(ExternalEncoding), input_name='termsOfUse'), ))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='asns', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.limitExceeded is not None:
            self.limitExceeded.export(outfile, level, namespace_, name_='limitExceeded', pretty_print=pretty_print)
        if self.asnRef is not None:
            self.asnRef.export(outfile, level, namespace_, name_='asnRef', pretty_print=pretty_print)
        if self.anytypeobjs_ is not None:
            self.anytypeobjs_.export(outfile, level, namespace_, pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='asns'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.termsOfUse is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            showIndent(outfile, level)
            outfile.write('termsOfUse="%s",\n' % (self.termsOfUse,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.limitExceeded is not None:
            showIndent(outfile, level)
            outfile.write('limitExceeded=model_.limitExceeded(\n')
            self.limitExceeded.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.asnRef is not None:
            showIndent(outfile, level)
            outfile.write('asnRef=model_.asnRef(\n')
            self.asnRef.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.anytypeobjs_ is not None:
            showIndent(outfile, level)
            outfile.write('anytypeobjs_=model_.anytypeobjs_(\n')
            self.anytypeobjs_.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        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_('termsOfUse', node)
        if value is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            self.termsOfUse = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'limitExceeded':
            obj_ = limitExceeded.factory()
            obj_.build(child_)
            self.set_limitExceeded(obj_)
        elif nodeName_ == 'asnRef':
            obj_ = asnRef.factory()
            obj_.build(child_)
            self.set_asnRef(obj_)
        else:
            obj_ = self.gds_build_any(child_, 'asns')
            if obj_ is not None:
                self.set_anytypeobjs_(obj_)
# end class asns

class iso3166_1(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, code2=None, code3=None, name=None, e164=None):
        self.code2 = code2
        self.code3 = code3
        self.name = name
        self.e164 = e164
    def factory(*args_, **kwargs_):
        if iso3166_1.subclass:
            return iso3166_1.subclass(*args_, **kwargs_)
        else:
            return iso3166_1(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_code2(self): return self.code2
    def set_code2(self, code2): self.code2 = code2
    def get_code3(self): return self.code3
    def set_code3(self, code3): self.code3 = code3
    def get_name(self): return self.name
    def set_name(self, name): self.name = name
    def get_e164(self): return self.e164
    def set_e164(self, e164): self.e164 = e164
    def hasContent_(self):
        if (
            self.code2 is not None or
            self.code3 is not None or
            self.name is not None or
            self.e164 is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='iso3166-1', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='iso3166-1')
        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_='v1:', name_='iso3166-1'):
        pass
    def exportChildren(self, outfile, level, namespace_='v1:', name_='iso3166-1', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.code2 is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%scode2>%s</%scode2>%s' % (namespace_, self.gds_format_string(quote_xml(self.code2).encode(ExternalEncoding), input_name='code2'), namespace_, eol_))
        if self.code3 is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%scode3>%s</%scode3>%s' % (namespace_, self.gds_format_string(quote_xml(self.code3).encode(ExternalEncoding), input_name='code3'), namespace_, eol_))
        if self.name is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sname>%s</%sname>%s' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_, eol_))
        if self.e164 is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%se164>%s</%se164>%s' % (namespace_, self.gds_format_integer(self.e164, input_name='e164'), namespace_, eol_))
    def exportLiteral(self, outfile, level, name_='iso3166-1'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.code2 is not None:
            showIndent(outfile, level)
            outfile.write('code2=%s,\n' % quote_python(self.code2).encode(ExternalEncoding))
        if self.code3 is not None:
            showIndent(outfile, level)
            outfile.write('code3=%s,\n' % quote_python(self.code3).encode(ExternalEncoding))
        if self.name is not None:
            showIndent(outfile, level)
            outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
        if self.e164 is not None:
            showIndent(outfile, level)
            outfile.write('e164=%d,\n' % self.e164)
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'code2':
            code2_ = child_.text
            code2_ = self.gds_validate_string(code2_, node, 'code2')
            self.code2 = code2_
        elif nodeName_ == 'code3':
            code3_ = child_.text
            code3_ = self.gds_validate_string(code3_, node, 'code3')
            self.code3 = code3_
        elif nodeName_ == 'name':
            name_ = child_.text
            name_ = self.gds_validate_string(name_, node, 'name')
            self.name = name_
        elif nodeName_ == 'e164':
            sval_ = child_.text
            try:
                ival_ = int(sval_)
            except (TypeError, ValueError), exp:
                raise_parse_error(child_, 'requires integer: %s' % exp)
            ival_ = self.gds_validate_integer(ival_, node, 'e164')
            self.e164 = ival_
# end class iso3166_1

class pocs(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, termsOfUse=None, limitExceeded=None, pocRef=None, pocLinkRef=None, anytypeobjs_=None):
        self.termsOfUse = _cast(None, termsOfUse)
        self.limitExceeded = limitExceeded
        self.pocRef = pocRef
        self.pocLinkRef = pocLinkRef
        self.anytypeobjs_ = anytypeobjs_
    def factory(*args_, **kwargs_):
        if pocs.subclass:
            return pocs.subclass(*args_, **kwargs_)
        else:
            return pocs(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_limitExceeded(self): return self.limitExceeded
    def set_limitExceeded(self, limitExceeded): self.limitExceeded = limitExceeded
    def get_pocRef(self): return self.pocRef
    def set_pocRef(self, pocRef): self.pocRef = pocRef
    def get_pocLinkRef(self): return self.pocLinkRef
    def set_pocLinkRef(self, pocLinkRef): self.pocLinkRef = pocLinkRef
    def get_anytypeobjs_(self): return self.anytypeobjs_
    def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_
    def get_termsOfUse(self): return self.termsOfUse
    def set_termsOfUse(self, termsOfUse): self.termsOfUse = termsOfUse
    def hasContent_(self):
        if (
            self.limitExceeded is not None or
            self.pocRef is not None or
            self.pocLinkRef is not None or
            self.anytypeobjs_ is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='pocs', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='pocs')
        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_='v1:', name_='pocs'):
        if self.termsOfUse is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            outfile.write(' termsOfUse=%s' % (self.gds_format_string(quote_attrib(self.termsOfUse).encode(ExternalEncoding), input_name='termsOfUse'), ))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='pocs', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.limitExceeded is not None:
            self.limitExceeded.export(outfile, level, namespace_, name_='limitExceeded', pretty_print=pretty_print)
        if self.pocRef is not None:
            self.pocRef.export(outfile, level, namespace_, name_='pocRef', pretty_print=pretty_print)
        if self.pocLinkRef is not None:
            self.pocLinkRef.export(outfile, level, namespace_, name_='pocLinkRef', pretty_print=pretty_print)
        if self.anytypeobjs_ is not None:
            self.anytypeobjs_.export(outfile, level, namespace_, pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='pocs'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.termsOfUse is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            showIndent(outfile, level)
            outfile.write('termsOfUse="%s",\n' % (self.termsOfUse,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.limitExceeded is not None:
            showIndent(outfile, level)
            outfile.write('limitExceeded=model_.limitExceeded(\n')
            self.limitExceeded.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.pocRef is not None:
            showIndent(outfile, level)
            outfile.write('pocRef=model_.pocRef(\n')
            self.pocRef.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.pocLinkRef is not None:
            showIndent(outfile, level)
            outfile.write('pocLinkRef=model_.pocLinkRef(\n')
            self.pocLinkRef.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.anytypeobjs_ is not None:
            showIndent(outfile, level)
            outfile.write('anytypeobjs_=model_.anytypeobjs_(\n')
            self.anytypeobjs_.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        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_('termsOfUse', node)
        if value is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            self.termsOfUse = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'limitExceeded':
            obj_ = limitExceeded.factory()
            obj_.build(child_)
            self.set_limitExceeded(obj_)
        elif nodeName_ == 'pocRef':
            obj_ = pocRef.factory()
            obj_.build(child_)
            self.set_pocRef(obj_)
        elif nodeName_ == 'pocLinkRef':
            obj_ = pocLinkRef.factory()
            obj_.build(child_)
            self.set_pocLinkRef(obj_)
        else:
            obj_ = self.gds_build_any(child_, 'pocs')
            if obj_ is not None:
                self.set_anytypeobjs_(obj_)
# end class pocs

class comment(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, line=None):
        if line is None:
            self.line = []
        else:
            self.line = line
    def factory(*args_, **kwargs_):
        if comment.subclass:
            return comment.subclass(*args_, **kwargs_)
        else:
            return comment(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_line(self): return self.line
    def set_line(self, line): self.line = line
    def add_line(self, value): self.line.append(value)
    def insert_line(self, index, value): self.line[index] = value
    def hasContent_(self):
        if (
            self.line
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='comment', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='comment')
        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_='v1:', name_='comment'):
        pass
    def exportChildren(self, outfile, level, namespace_='v1:', name_='comment', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for line_ in self.line:
            line_.export(outfile, level, namespace_, name_='line', pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='comment'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('line=[\n')
        level += 1
        for line_ in self.line:
            showIndent(outfile, level)
            outfile.write('model_.line(\n')
            line_.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'line':
            obj_ = line.factory()
            obj_.build(child_)
            self.line.append(obj_)
# end class comment

class streetAddress(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, line=None):
        if line is None:
            self.line = []
        else:
            self.line = line
    def factory(*args_, **kwargs_):
        if streetAddress.subclass:
            return streetAddress.subclass(*args_, **kwargs_)
        else:
            return streetAddress(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_line(self): return self.line
    def set_line(self, line): self.line = line
    def add_line(self, value): self.line.append(value)
    def insert_line(self, index, value): self.line[index] = value
    def hasContent_(self):
        if (
            self.line
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='streetAddress', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='streetAddress')
        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_='v1:', name_='streetAddress'):
        pass
    def exportChildren(self, outfile, level, namespace_='v1:', name_='streetAddress', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for line_ in self.line:
            line_.export(outfile, level, namespace_, name_='line', pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='streetAddress'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('line=[\n')
        level += 1
        for line_ in self.line:
            showIndent(outfile, level)
            outfile.write('model_.line(\n')
            line_.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'line':
            obj_ = line.factory()
            obj_.build(child_)
            self.line.append(obj_)
# end class streetAddress

class nets(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, termsOfUse=None, limitExceeded=None, netRef=None, anytypeobjs_=None):
        self.termsOfUse = _cast(None, termsOfUse)
        self.limitExceeded = limitExceeded
        self.netRef = netRef
        self.anytypeobjs_ = anytypeobjs_
    def factory(*args_, **kwargs_):
        if nets.subclass:
            return nets.subclass(*args_, **kwargs_)
        else:
            return nets(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_limitExceeded(self): return self.limitExceeded
    def set_limitExceeded(self, limitExceeded): self.limitExceeded = limitExceeded
    def get_netRef(self): return self.netRef
    def set_netRef(self, netRef): self.netRef = netRef
    def get_anytypeobjs_(self): return self.anytypeobjs_
    def set_anytypeobjs_(self, anytypeobjs_): self.anytypeobjs_ = anytypeobjs_
    def get_termsOfUse(self): return self.termsOfUse
    def set_termsOfUse(self, termsOfUse): self.termsOfUse = termsOfUse
    def hasContent_(self):
        if (
            self.limitExceeded is not None or
            self.netRef is not None or
            self.anytypeobjs_ is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='nets', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='nets')
        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_='v1:', name_='nets'):
        if self.termsOfUse is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            outfile.write(' termsOfUse=%s' % (self.gds_format_string(quote_attrib(self.termsOfUse).encode(ExternalEncoding), input_name='termsOfUse'), ))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='nets', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.limitExceeded is not None:
            self.limitExceeded.export(outfile, level, namespace_, name_='limitExceeded', pretty_print=pretty_print)
        if self.netRef is not None:
            self.netRef.export(outfile, level, namespace_, name_='netRef', pretty_print=pretty_print)
        if self.anytypeobjs_ is not None:
            self.anytypeobjs_.export(outfile, level, namespace_, pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='nets'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        if self.termsOfUse is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            showIndent(outfile, level)
            outfile.write('termsOfUse="%s",\n' % (self.termsOfUse,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.limitExceeded is not None:
            showIndent(outfile, level)
            outfile.write('limitExceeded=model_.limitExceeded(\n')
            self.limitExceeded.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.netRef is not None:
            showIndent(outfile, level)
            outfile.write('netRef=model_.netRef(\n')
            self.netRef.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.anytypeobjs_ is not None:
            showIndent(outfile, level)
            outfile.write('anytypeobjs_=model_.anytypeobjs_(\n')
            self.anytypeobjs_.exportLiteral(outfile, level)
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        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_('termsOfUse', node)
        if value is not None and 'termsOfUse' not in already_processed:
            already_processed.add('termsOfUse')
            self.termsOfUse = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'limitExceeded':
            obj_ = limitExceeded.factory()
            obj_.build(child_)
            self.set_limitExceeded(obj_)
        elif nodeName_ == 'netRef':
            obj_ = netRef.factory()
            obj_.build(child_)
            self.set_netRef(obj_)
        else:
            obj_ = self.gds_build_any(child_, 'nets')
            if obj_ is not None:
                self.set_anytypeobjs_(obj_)
# end class nets

class limitExceeded(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, limit=None, valueOf_=None):
        self.limit = _cast(int, limit)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if limitExceeded.subclass:
            return limitExceeded.subclass(*args_, **kwargs_)
        else:
            return limitExceeded(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_limit(self): return self.limit
    def set_limit(self, limit): self.limit = limit
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='limitExceeded', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='limitExceeded')
        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_='v1:', name_='limitExceeded'):
        if self.limit is not None and 'limit' not in already_processed:
            already_processed.add('limit')
            outfile.write(' limit="%s"' % self.gds_format_integer(self.limit, input_name='limit'))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='limitExceeded', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='limitExceeded'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, 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.limit is not None and 'limit' not in already_processed:
            already_processed.add('limit')
            showIndent(outfile, level)
            outfile.write('limit=%d,\n' % (self.limit,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        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_('limit', node)
        if value is not None and 'limit' not in already_processed:
            already_processed.add('limit')
            try:
                self.limit = int(value)
            except ValueError, exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class limitExceeded

class asnRef(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, handle=None, name=None, valueOf_=None):
        self.handle = _cast(None, handle)
        self.name = _cast(None, name)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if asnRef.subclass:
            return asnRef.subclass(*args_, **kwargs_)
        else:
            return asnRef(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_handle(self): return self.handle
    def set_handle(self, handle): self.handle = handle
    def get_name(self): return self.name
    def set_name(self, name): self.name = name
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='asnRef', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='asnRef')
        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_='v1:', name_='asnRef'):
        if self.handle is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            outfile.write(' handle=%s' % (self.gds_format_string(quote_attrib(self.handle).encode(ExternalEncoding), input_name='handle'), ))
        if self.name is not None and 'name' not in already_processed:
            already_processed.add('name')
            outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='asnRef', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='asnRef'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, 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.handle is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            showIndent(outfile, level)
            outfile.write('handle="%s",\n' % (self.handle,))
        if self.name is not None and 'name' not in already_processed:
            already_processed.add('name')
            showIndent(outfile, level)
            outfile.write('name="%s",\n' % (self.name,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        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_('handle', node)
        if value is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            self.handle = value
        value = find_attr_value_('name', node)
        if value is not None and 'name' not in already_processed:
            already_processed.add('name')
            self.name = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class asnRef

class pocRef(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, handle=None, name=None, valueOf_=None):
        self.handle = _cast(None, handle)
        self.name = _cast(None, name)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if pocRef.subclass:
            return pocRef.subclass(*args_, **kwargs_)
        else:
            return pocRef(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_handle(self): return self.handle
    def set_handle(self, handle): self.handle = handle
    def get_name(self): return self.name
    def set_name(self, name): self.name = name
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='pocRef', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='pocRef')
        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_='v1:', name_='pocRef'):
        if self.handle is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            outfile.write(' handle=%s' % (self.gds_format_string(quote_attrib(self.handle).encode(ExternalEncoding), input_name='handle'), ))
        if self.name is not None and 'name' not in already_processed:
            already_processed.add('name')
            outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='pocRef', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='pocRef'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, 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.handle is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            showIndent(outfile, level)
            outfile.write('handle="%s",\n' % (self.handle,))
        if self.name is not None and 'name' not in already_processed:
            already_processed.add('name')
            showIndent(outfile, level)
            outfile.write('name="%s",\n' % (self.name,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        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_('handle', node)
        if value is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            self.handle = value
        value = find_attr_value_('name', node)
        if value is not None and 'name' not in already_processed:
            already_processed.add('name')
            self.name = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class pocRef

class pocLinkRef(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, function=None, handle=None, description=None, valueOf_=None):
        self.function = _cast(None, function)
        self.handle = _cast(None, handle)
        self.description = _cast(None, description)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if pocLinkRef.subclass:
            return pocLinkRef.subclass(*args_, **kwargs_)
        else:
            return pocLinkRef(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_function(self): return self.function
    def set_function(self, function): self.function = function
    def get_handle(self): return self.handle
    def set_handle(self, handle): self.handle = handle
    def get_description(self): return self.description
    def set_description(self, description): self.description = description
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='pocLinkRef', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='pocLinkRef')
        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_='v1:', name_='pocLinkRef'):
        if self.function is not None and 'function' not in already_processed:
            already_processed.add('function')
            outfile.write(' function=%s' % (self.gds_format_string(quote_attrib(self.function).encode(ExternalEncoding), input_name='function'), ))
        if self.handle is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            outfile.write(' handle=%s' % (self.gds_format_string(quote_attrib(self.handle).encode(ExternalEncoding), input_name='handle'), ))
        if self.description is not None and 'description' not in already_processed:
            already_processed.add('description')
            outfile.write(' description=%s' % (self.gds_format_string(quote_attrib(self.description).encode(ExternalEncoding), input_name='description'), ))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='pocLinkRef', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='pocLinkRef'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, 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.function is not None and 'function' not in already_processed:
            already_processed.add('function')
            showIndent(outfile, level)
            outfile.write('function="%s",\n' % (self.function,))
        if self.handle is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            showIndent(outfile, level)
            outfile.write('handle="%s",\n' % (self.handle,))
        if self.description is not None and 'description' not in already_processed:
            already_processed.add('description')
            showIndent(outfile, level)
            outfile.write('description="%s",\n' % (self.description,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        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_('function', node)
        if value is not None and 'function' not in already_processed:
            already_processed.add('function')
            self.function = value
        value = find_attr_value_('handle', node)
        if value is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            self.handle = value
        value = find_attr_value_('description', node)
        if value is not None and 'description' not in already_processed:
            already_processed.add('description')
            self.description = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class pocLinkRef

class line(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, number=None, valueOf_=None, mixedclass_=None, content_=None):
        self.number = _cast(int, number)
        self.valueOf_ = valueOf_
        if mixedclass_ is None:
            self.mixedclass_ = MixedContainer
        else:
            self.mixedclass_ = mixedclass_
        if content_ is None:
            self.content_ = []
        else:
            self.content_ = content_
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if line.subclass:
            return line.subclass(*args_, **kwargs_)
        else:
            return line(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_number(self): return self.number
    def set_number(self, number): self.number = number
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='line', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='line')
        outfile.write('>')
        self.exportChildren(outfile, level + 1, namespace_, name_, pretty_print=pretty_print)
        outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
    def exportAttributes(self, outfile, level, already_processed, namespace_='v1:', name_='line'):
        if self.number is not None and 'number' not in already_processed:
            already_processed.add('number')
            outfile.write(' number="%s"' % self.gds_format_integer(self.number, input_name='number'))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='line', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='line'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, 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.number is not None and 'number' not in already_processed:
            already_processed.add('number')
            showIndent(outfile, level)
            outfile.write('number=%d,\n' % (self.number,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        self.valueOf_ = get_all_text_(node)
        if node.text is not None:
            obj_ = self.mixedclass_(MixedContainer.CategoryText,
                MixedContainer.TypeNone, '', node.text)
            self.content_.append(obj_)
        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_('number', node)
        if value is not None and 'number' not in already_processed:
            already_processed.add('number')
            try:
                self.number = int(value)
            except ValueError, exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if not fromsubclass_ and child_.tail is not None:
            obj_ = self.mixedclass_(MixedContainer.CategoryText,
                MixedContainer.TypeNone, '', child_.tail)
            self.content_.append(obj_)
        pass
# end class line

class netRef(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, startAddress=None, endAddress=None, handle=None, name=None, valueOf_=None):
        self.startAddress = _cast(None, startAddress)
        self.endAddress = _cast(None, endAddress)
        self.handle = _cast(None, handle)
        self.name = _cast(None, name)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if netRef.subclass:
            return netRef.subclass(*args_, **kwargs_)
        else:
            return netRef(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_startAddress(self): return self.startAddress
    def set_startAddress(self, startAddress): self.startAddress = startAddress
    def get_endAddress(self): return self.endAddress
    def set_endAddress(self, endAddress): self.endAddress = endAddress
    def get_handle(self): return self.handle
    def set_handle(self, handle): self.handle = handle
    def get_name(self): return self.name
    def set_name(self, name): self.name = name
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='v1:', name_='netRef', 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 = set()
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='netRef')
        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_='v1:', name_='netRef'):
        if self.startAddress is not None and 'startAddress' not in already_processed:
            already_processed.add('startAddress')
            outfile.write(' startAddress=%s' % (self.gds_format_string(quote_attrib(self.startAddress).encode(ExternalEncoding), input_name='startAddress'), ))
        if self.endAddress is not None and 'endAddress' not in already_processed:
            already_processed.add('endAddress')
            outfile.write(' endAddress=%s' % (self.gds_format_string(quote_attrib(self.endAddress).encode(ExternalEncoding), input_name='endAddress'), ))
        if self.handle is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            outfile.write(' handle=%s' % (self.gds_format_string(quote_attrib(self.handle).encode(ExternalEncoding), input_name='handle'), ))
        if self.name is not None and 'name' not in already_processed:
            already_processed.add('name')
            outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
    def exportChildren(self, outfile, level, namespace_='v1:', name_='netRef', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='netRef'):
        level += 1
        already_processed = set()
        self.exportLiteralAttributes(outfile, level, already_processed, 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.startAddress is not None and 'startAddress' not in already_processed:
            already_processed.add('startAddress')
            showIndent(outfile, level)
            outfile.write('startAddress="%s",\n' % (self.startAddress,))
        if self.endAddress is not None and 'endAddress' not in already_processed:
            already_processed.add('endAddress')
            showIndent(outfile, level)
            outfile.write('endAddress="%s",\n' % (self.endAddress,))
        if self.handle is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            showIndent(outfile, level)
            outfile.write('handle="%s",\n' % (self.handle,))
        if self.name is not None and 'name' not in already_processed:
            already_processed.add('name')
            showIndent(outfile, level)
            outfile.write('name="%s",\n' % (self.name,))
    def exportLiteralChildren(self, outfile, level, name_):
        pass
    def build(self, node):
        already_processed = set()
        self.buildAttributes(node, node.attrib, already_processed)
        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_('startAddress', node)
        if value is not None and 'startAddress' not in already_processed:
            already_processed.add('startAddress')
            self.startAddress = value
        value = find_attr_value_('endAddress', node)
        if value is not None and 'endAddress' not in already_processed:
            already_processed.add('endAddress')
            self.endAddress = value
        value = find_attr_value_('handle', node)
        if value is not None and 'handle' not in already_processed:
            already_processed.add('handle')
            self.handle = value
        value = find_attr_value_('name', node)
        if value is not None and 'name' not in already_processed:
            already_processed.add('name')
            self.name = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class netRef

GDSClassesMapping = {
}

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 = GDSClassesMapping.get(tag)
    if rootClass is None:
        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 = 'org'
        rootClass = org
    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_='xmlns=http://www.arin.net/whoisrws/core/v1',
        pretty_print=True)
    return rootObj

def parseEtree(inFileName):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'org'
        rootClass = org
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    mapping = {}
    rootElement = rootObj.to_etree(None, name_=rootTag, mapping_=mapping)
    reverse_mapping = rootObj.gds_reverse_node_mapping(mapping)
    content = etree_.tostring(
        rootElement, pretty_print=True,
        xml_declaration=True, encoding="utf-8")
    sys.stdout.write(content)
    sys.stdout.write('\n')
    return rootObj, rootElement, mapping, reverse_mapping

def parseString(inString):
    from StringIO import StringIO
    doc = parsexml_(StringIO(inString))
    rootNode = doc.getroot()
    roots = get_root_tag(rootNode)
    rootClass = roots[1]
    if rootClass is None:
        rootClass = org
    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_="org",
        namespacedef_='xmlns=http://www.arin.net/whoisrws/core/v1')
    return rootObj

def parseLiteral(inFileName):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'org'
        rootClass = org
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    sys.stdout.write('#from org import *\n\n')
    sys.stdout.write('import org 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__ = [
    "asnRef",
    "asns",
    "comment",
    "iso3166_1",
    "limitExceeded",
    "line",
    "netRef",
    "nets",
    "org",
    "pocLinkRef",
    "pocRef",
    "pocs",
    "streetAddress"
]