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

###
# Copyright 2014 Code Master Oy (http://www.codemaster.fi/)
#
# This file is part of py-finvoice.
#
# py-finvoice is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# py-finvoice is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with py-finvoice. If not, see <http://www.gnu.org/licenses/>.
##

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=''):
            if not input_data:
                return ''
            else:
                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 ('%.15f' % input_data).rstrip('0')
        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, 'UTC')
                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]
            time_parts = input_data.split('.')
            if len(time_parts) > 1:
                micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
                input_data = '%s.%s' % (time_parts[0], micro_seconds, )
                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, 'UTC')
                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, 'UTC')
                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):
            continue
            # outfile.write('    ')


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


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


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


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


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


class GDSParseError(Exception):
    pass


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


class MixedContainer:
    # Constants for category:
    CategoryNone = 0
    CategoryText = 1
    CategorySimple = 2
    CategoryComplex = 3
    # Constants for content_type:
    TypeNone = 0
    TypeText = 1
    TypeString = 2
    TypeInteger = 3
    TypeFloat = 4
    TypeDecimal = 5
    TypeDouble = 6
    TypeBoolean = 7
    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 FinvoiceReceiverInfo(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, Version=None, MessageDetails=None, SellerPartyDetails=None, SellerOrganisationUnitNumber=None, InvoiceSenderInformationDetails=None, SellerAccountDetails=None, SellerInvoiceDetails=None, ReceiverInfoTimeStamp=None, BuyerPartyDetails=None, InvoiceRecipientDetails=None, ProposedDueDate=None, ProposedInvoicePeriod=None, BuyerServiceCode=None, ConversionDetails=None):
        self.original_tagname_ = None
        self.Version = _cast(None, Version)
        self.MessageDetails = MessageDetails
        self.SellerPartyDetails = SellerPartyDetails
        self.SellerOrganisationUnitNumber = SellerOrganisationUnitNumber
        self.InvoiceSenderInformationDetails = InvoiceSenderInformationDetails
        if SellerAccountDetails is None:
            self.SellerAccountDetails = []
        else:
            self.SellerAccountDetails = SellerAccountDetails
        self.SellerInvoiceDetails = SellerInvoiceDetails
        self.ReceiverInfoTimeStamp = ReceiverInfoTimeStamp
        self.BuyerPartyDetails = BuyerPartyDetails
        self.InvoiceRecipientDetails = InvoiceRecipientDetails
        self.ProposedDueDate = ProposedDueDate
        self.ProposedInvoicePeriod = ProposedInvoicePeriod
        self.BuyerServiceCode = BuyerServiceCode
        self.ConversionDetails = ConversionDetails
    def factory(*args_, **kwargs_):
        if FinvoiceReceiverInfo.subclass:
            return FinvoiceReceiverInfo.subclass(*args_, **kwargs_)
        else:
            return FinvoiceReceiverInfo(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_MessageDetails(self): return self.MessageDetails
    def set_MessageDetails(self, MessageDetails): self.MessageDetails = MessageDetails
    def get_SellerPartyDetails(self): return self.SellerPartyDetails
    def set_SellerPartyDetails(self, SellerPartyDetails): self.SellerPartyDetails = SellerPartyDetails
    def get_SellerOrganisationUnitNumber(self): return self.SellerOrganisationUnitNumber
    def set_SellerOrganisationUnitNumber(self, SellerOrganisationUnitNumber): self.SellerOrganisationUnitNumber = SellerOrganisationUnitNumber
    def get_InvoiceSenderInformationDetails(self): return self.InvoiceSenderInformationDetails
    def set_InvoiceSenderInformationDetails(self, InvoiceSenderInformationDetails): self.InvoiceSenderInformationDetails = InvoiceSenderInformationDetails
    def get_SellerAccountDetails(self): return self.SellerAccountDetails
    def set_SellerAccountDetails(self, SellerAccountDetails): self.SellerAccountDetails = SellerAccountDetails
    def add_SellerAccountDetails(self, value): self.SellerAccountDetails.append(value)
    def insert_SellerAccountDetails_at(self, index, value): self.SellerAccountDetails.insert(index, value)
    def replace_SellerAccountDetails_at(self, index, value): self.SellerAccountDetails[index] = value
    def get_SellerInvoiceDetails(self): return self.SellerInvoiceDetails
    def set_SellerInvoiceDetails(self, SellerInvoiceDetails): self.SellerInvoiceDetails = SellerInvoiceDetails
    def get_ReceiverInfoTimeStamp(self): return self.ReceiverInfoTimeStamp
    def set_ReceiverInfoTimeStamp(self, ReceiverInfoTimeStamp): self.ReceiverInfoTimeStamp = ReceiverInfoTimeStamp
    def get_BuyerPartyDetails(self): return self.BuyerPartyDetails
    def set_BuyerPartyDetails(self, BuyerPartyDetails): self.BuyerPartyDetails = BuyerPartyDetails
    def get_InvoiceRecipientDetails(self): return self.InvoiceRecipientDetails
    def set_InvoiceRecipientDetails(self, InvoiceRecipientDetails): self.InvoiceRecipientDetails = InvoiceRecipientDetails
    def get_ProposedDueDate(self): return self.ProposedDueDate
    def set_ProposedDueDate(self, ProposedDueDate): self.ProposedDueDate = ProposedDueDate
    def get_ProposedInvoicePeriod(self): return self.ProposedInvoicePeriod
    def set_ProposedInvoicePeriod(self, ProposedInvoicePeriod): self.ProposedInvoicePeriod = ProposedInvoicePeriod
    def get_BuyerServiceCode(self): return self.BuyerServiceCode
    def set_BuyerServiceCode(self, BuyerServiceCode): self.BuyerServiceCode = BuyerServiceCode
    def get_ConversionDetails(self): return self.ConversionDetails
    def set_ConversionDetails(self, ConversionDetails): self.ConversionDetails = ConversionDetails
    def get_Version(self): return self.Version
    def set_Version(self, Version): self.Version = Version
    def validate_genericStringType5_35(self, value):
        # Validate type genericStringType5_35, a restriction on xs:string.
        pass
    def validate_genericStringType0_22(self, value):
        # Validate type genericStringType0_22, a restriction on xs:string.
        pass
    def validate_ProposedDueDateType(self, value):
        # Validate type ProposedDueDateType, a restriction on xs:integer.
        pass
    def validate_ProposedInvoicePeriodType(self, value):
        # Validate type ProposedInvoicePeriodType, a restriction on xs:integer.
        pass
    def validate_BuyerServiceCodeType(self, value):
        # Validate type BuyerServiceCodeType, a restriction on xs:NMTOKEN.
        pass
    def hasContent_(self):
        if (
            self.MessageDetails is not None or
            self.SellerPartyDetails is not None or
            self.SellerOrganisationUnitNumber is not None or
            self.InvoiceSenderInformationDetails is not None or
            self.SellerAccountDetails or
            self.SellerInvoiceDetails is not None or
            self.ReceiverInfoTimeStamp is not None or
            self.BuyerPartyDetails is not None or
            self.InvoiceRecipientDetails is not None or
            self.ProposedDueDate is not None or
            self.ProposedInvoicePeriod is not None or
            self.BuyerServiceCode is not None or
            self.ConversionDetails is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='FinvoiceReceiverInfo', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='FinvoiceReceiverInfo')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='FinvoiceReceiverInfo', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='FinvoiceReceiverInfo'):
        if self.Version is not None and 'Version' not in already_processed:
            already_processed.add('Version')
            outfile.write(' Version=%s' % (self.gds_format_string(quote_attrib(self.Version).encode(ExternalEncoding), input_name='Version'), ))
    def exportChildren(self, outfile, level, namespace_='', name_='FinvoiceReceiverInfo', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.MessageDetails is not None:
            self.MessageDetails.export(outfile, level, namespace_, name_='MessageDetails', pretty_print=pretty_print)
        if self.SellerPartyDetails is not None:
            self.SellerPartyDetails.export(outfile, level, namespace_, name_='SellerPartyDetails', pretty_print=pretty_print)
        if self.SellerOrganisationUnitNumber is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerOrganisationUnitNumber>%s</%sSellerOrganisationUnitNumber>%s' % (namespace_, self.gds_format_string(quote_xml(self.SellerOrganisationUnitNumber).encode(ExternalEncoding), input_name='SellerOrganisationUnitNumber'), namespace_, eol_))
        if self.InvoiceSenderInformationDetails is not None:
            self.InvoiceSenderInformationDetails.export(outfile, level, namespace_, name_='InvoiceSenderInformationDetails', pretty_print=pretty_print)
        for SellerAccountDetails_ in self.SellerAccountDetails:
            SellerAccountDetails_.export(outfile, level, namespace_, name_='SellerAccountDetails', pretty_print=pretty_print)
        if self.SellerInvoiceDetails is not None:
            self.SellerInvoiceDetails.export(outfile, level, namespace_, name_='SellerInvoiceDetails', pretty_print=pretty_print)
        if self.ReceiverInfoTimeStamp is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sReceiverInfoTimeStamp>%s</%sReceiverInfoTimeStamp>%s' % (namespace_, self.gds_format_string(quote_xml(self.ReceiverInfoTimeStamp).encode(ExternalEncoding), input_name='ReceiverInfoTimeStamp'), namespace_, eol_))
        if self.BuyerPartyDetails is not None:
            self.BuyerPartyDetails.export(outfile, level, namespace_, name_='BuyerPartyDetails', pretty_print=pretty_print)
        if self.InvoiceRecipientDetails is not None:
            self.InvoiceRecipientDetails.export(outfile, level, namespace_, name_='InvoiceRecipientDetails', pretty_print=pretty_print)
        if self.ProposedDueDate is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sProposedDueDate>%s</%sProposedDueDate>%s' % (namespace_, self.gds_format_integer(self.ProposedDueDate, input_name='ProposedDueDate'), namespace_, eol_))
        if self.ProposedInvoicePeriod is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sProposedInvoicePeriod>%s</%sProposedInvoicePeriod>%s' % (namespace_, self.gds_format_integer(self.ProposedInvoicePeriod, input_name='ProposedInvoicePeriod'), namespace_, eol_))
        if self.BuyerServiceCode is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sBuyerServiceCode>%s</%sBuyerServiceCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.BuyerServiceCode).encode(ExternalEncoding), input_name='BuyerServiceCode'), namespace_, eol_))
        if self.ConversionDetails is not None:
            self.ConversionDetails.export(outfile, level, namespace_, name_='ConversionDetails', pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='FinvoiceReceiverInfo'):
        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.Version is not None and 'Version' not in already_processed:
            already_processed.add('Version')
            showIndent(outfile, level)
            outfile.write('Version="%s",\n' % (self.Version,))
    def exportLiteralChildren(self, outfile, level, name_):
        if self.MessageDetails is not None:
            showIndent(outfile, level)
            outfile.write('MessageDetails=model_.MessageDetailsType(\n')
            self.MessageDetails.exportLiteral(outfile, level, name_='MessageDetails')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.SellerPartyDetails is not None:
            showIndent(outfile, level)
            outfile.write('SellerPartyDetails=model_.SellerPartyDetailsType(\n')
            self.SellerPartyDetails.exportLiteral(outfile, level, name_='SellerPartyDetails')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.SellerOrganisationUnitNumber is not None:
            showIndent(outfile, level)
            outfile.write('SellerOrganisationUnitNumber=%s,\n' % quote_python(self.SellerOrganisationUnitNumber).encode(ExternalEncoding))
        if self.InvoiceSenderInformationDetails is not None:
            showIndent(outfile, level)
            outfile.write('InvoiceSenderInformationDetails=model_.InvoiceSenderInformationDetailsType(\n')
            self.InvoiceSenderInformationDetails.exportLiteral(outfile, level, name_='InvoiceSenderInformationDetails')
            showIndent(outfile, level)
            outfile.write('),\n')
        showIndent(outfile, level)
        outfile.write('SellerAccountDetails=[\n')
        level += 1
        for SellerAccountDetails_ in self.SellerAccountDetails:
            showIndent(outfile, level)
            outfile.write('model_.SellerAccountDetailsType(\n')
            SellerAccountDetails_.exportLiteral(outfile, level, name_='SellerAccountDetailsType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.SellerInvoiceDetails is not None:
            showIndent(outfile, level)
            outfile.write('SellerInvoiceDetails=model_.SellerInvoiceDetailsType(\n')
            self.SellerInvoiceDetails.exportLiteral(outfile, level, name_='SellerInvoiceDetails')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.ReceiverInfoTimeStamp is not None:
            showIndent(outfile, level)
            outfile.write('ReceiverInfoTimeStamp=%s,\n' % quote_python(self.ReceiverInfoTimeStamp).encode(ExternalEncoding))
        if self.BuyerPartyDetails is not None:
            showIndent(outfile, level)
            outfile.write('BuyerPartyDetails=model_.BuyerPartyDetailsType(\n')
            self.BuyerPartyDetails.exportLiteral(outfile, level, name_='BuyerPartyDetails')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.InvoiceRecipientDetails is not None:
            showIndent(outfile, level)
            outfile.write('InvoiceRecipientDetails=model_.InvoiceRecipientDetailsType(\n')
            self.InvoiceRecipientDetails.exportLiteral(outfile, level, name_='InvoiceRecipientDetails')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.ProposedDueDate is not None:
            showIndent(outfile, level)
            outfile.write('ProposedDueDate=%d,\n' % self.ProposedDueDate)
        if self.ProposedInvoicePeriod is not None:
            showIndent(outfile, level)
            outfile.write('ProposedInvoicePeriod=%d,\n' % self.ProposedInvoicePeriod)
        if self.BuyerServiceCode is not None:
            showIndent(outfile, level)
            outfile.write('BuyerServiceCode=%s,\n' % quote_python(self.BuyerServiceCode).encode(ExternalEncoding))
        if self.ConversionDetails is not None:
            showIndent(outfile, level)
            outfile.write('ConversionDetails=model_.ConversionDetailsType(\n')
            self.ConversionDetails.exportLiteral(outfile, level, name_='ConversionDetails')
            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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Version', node)
        if value is not None and 'Version' not in already_processed:
            already_processed.add('Version')
            self.Version = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'MessageDetails':
            obj_ = MessageDetailsType.factory()
            obj_.build(child_)
            self.MessageDetails = obj_
            obj_.original_tagname_ = 'MessageDetails'
        elif nodeName_ == 'SellerPartyDetails':
            obj_ = SellerPartyDetailsType.factory()
            obj_.build(child_)
            self.SellerPartyDetails = obj_
            obj_.original_tagname_ = 'SellerPartyDetails'
        elif nodeName_ == 'SellerOrganisationUnitNumber':
            SellerOrganisationUnitNumber_ = child_.text
            SellerOrganisationUnitNumber_ = self.gds_validate_string(SellerOrganisationUnitNumber_, node, 'SellerOrganisationUnitNumber')
            self.SellerOrganisationUnitNumber = SellerOrganisationUnitNumber_
            self.validate_genericStringType5_35(self.SellerOrganisationUnitNumber)    # validate type genericStringType5_35
        elif nodeName_ == 'InvoiceSenderInformationDetails':
            obj_ = InvoiceSenderInformationDetailsType.factory()
            obj_.build(child_)
            self.InvoiceSenderInformationDetails = obj_
            obj_.original_tagname_ = 'InvoiceSenderInformationDetails'
        elif nodeName_ == 'SellerAccountDetails':
            obj_ = SellerAccountDetailsType.factory()
            obj_.build(child_)
            self.SellerAccountDetails.append(obj_)
            obj_.original_tagname_ = 'SellerAccountDetails'
        elif nodeName_ == 'SellerInvoiceDetails':
            obj_ = SellerInvoiceDetailsType.factory()
            obj_.build(child_)
            self.SellerInvoiceDetails = obj_
            obj_.original_tagname_ = 'SellerInvoiceDetails'
        elif nodeName_ == 'ReceiverInfoTimeStamp':
            ReceiverInfoTimeStamp_ = child_.text
            ReceiverInfoTimeStamp_ = self.gds_validate_string(ReceiverInfoTimeStamp_, node, 'ReceiverInfoTimeStamp')
            self.ReceiverInfoTimeStamp = ReceiverInfoTimeStamp_
            self.validate_genericStringType0_22(self.ReceiverInfoTimeStamp)    # validate type genericStringType0_22
        elif nodeName_ == 'BuyerPartyDetails':
            obj_ = BuyerPartyDetailsType.factory()
            obj_.build(child_)
            self.BuyerPartyDetails = obj_
            obj_.original_tagname_ = 'BuyerPartyDetails'
        elif nodeName_ == 'InvoiceRecipientDetails':
            obj_ = InvoiceRecipientDetailsType.factory()
            obj_.build(child_)
            self.InvoiceRecipientDetails = obj_
            obj_.original_tagname_ = 'InvoiceRecipientDetails'
        elif nodeName_ == 'ProposedDueDate':
            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, 'ProposedDueDate')
            self.ProposedDueDate = ival_
            self.validate_ProposedDueDateType(self.ProposedDueDate)    # validate type ProposedDueDateType
        elif nodeName_ == 'ProposedInvoicePeriod':
            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, 'ProposedInvoicePeriod')
            self.ProposedInvoicePeriod = ival_
            self.validate_ProposedInvoicePeriodType(self.ProposedInvoicePeriod)    # validate type ProposedInvoicePeriodType
        elif nodeName_ == 'BuyerServiceCode':
            BuyerServiceCode_ = child_.text
            BuyerServiceCode_ = self.gds_validate_string(BuyerServiceCode_, node, 'BuyerServiceCode')
            self.BuyerServiceCode = BuyerServiceCode_
            self.validate_BuyerServiceCodeType(self.BuyerServiceCode)    # validate type BuyerServiceCodeType
        elif nodeName_ == 'ConversionDetails':
            obj_ = ConversionDetailsType.factory()
            obj_.build(child_)
            self.ConversionDetails = obj_
            obj_.original_tagname_ = 'ConversionDetails'
# end class FinvoiceReceiverInfo


class BuyerPartyDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, BuyerPartyIdentifier=None, BuyerOrganisationName=None, BuyerPostalAddressDetails=None):
        self.original_tagname_ = None
        self.BuyerPartyIdentifier = BuyerPartyIdentifier
        self.BuyerOrganisationName = BuyerOrganisationName
        self.BuyerPostalAddressDetails = BuyerPostalAddressDetails
    def factory(*args_, **kwargs_):
        if BuyerPartyDetailsType.subclass:
            return BuyerPartyDetailsType.subclass(*args_, **kwargs_)
        else:
            return BuyerPartyDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_BuyerPartyIdentifier(self): return self.BuyerPartyIdentifier
    def set_BuyerPartyIdentifier(self, BuyerPartyIdentifier): self.BuyerPartyIdentifier = BuyerPartyIdentifier
    def get_BuyerOrganisationName(self): return self.BuyerOrganisationName
    def set_BuyerOrganisationName(self, BuyerOrganisationName): self.BuyerOrganisationName = BuyerOrganisationName
    def get_BuyerPostalAddressDetails(self): return self.BuyerPostalAddressDetails
    def set_BuyerPostalAddressDetails(self, BuyerPostalAddressDetails): self.BuyerPostalAddressDetails = BuyerPostalAddressDetails
    def validate_genericStringType1_48(self, value):
        # Validate type genericStringType1_48, a restriction on xs:string.
        pass
    def validate_genericStringType2_70(self, value):
        # Validate type genericStringType2_70, a restriction on xs:string.
        pass
    def hasContent_(self):
        if (
            self.BuyerPartyIdentifier is not None or
            self.BuyerOrganisationName is not None or
            self.BuyerPostalAddressDetails is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='BuyerPartyDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='BuyerPartyDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='BuyerPartyDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='BuyerPartyDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='BuyerPartyDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.BuyerPartyIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sBuyerPartyIdentifier>%s</%sBuyerPartyIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.BuyerPartyIdentifier).encode(ExternalEncoding), input_name='BuyerPartyIdentifier'), namespace_, eol_))
        if self.BuyerOrganisationName is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sBuyerOrganisationName>%s</%sBuyerOrganisationName>%s' % (namespace_, self.gds_format_string(quote_xml(self.BuyerOrganisationName).encode(ExternalEncoding), input_name='BuyerOrganisationName'), namespace_, eol_))
        if self.BuyerPostalAddressDetails is not None:
            self.BuyerPostalAddressDetails.export(outfile, level, namespace_, name_='BuyerPostalAddressDetails', pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='BuyerPartyDetailsType'):
        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.BuyerPartyIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('BuyerPartyIdentifier=%s,\n' % quote_python(self.BuyerPartyIdentifier).encode(ExternalEncoding))
        if self.BuyerOrganisationName is not None:
            showIndent(outfile, level)
            outfile.write('BuyerOrganisationName=%s,\n' % quote_python(self.BuyerOrganisationName).encode(ExternalEncoding))
        if self.BuyerPostalAddressDetails is not None:
            showIndent(outfile, level)
            outfile.write('BuyerPostalAddressDetails=model_.BuyerPostalAddressDetailsType(\n')
            self.BuyerPostalAddressDetails.exportLiteral(outfile, level, name_='BuyerPostalAddressDetails')
            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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'BuyerPartyIdentifier':
            BuyerPartyIdentifier_ = child_.text
            BuyerPartyIdentifier_ = self.gds_validate_string(BuyerPartyIdentifier_, node, 'BuyerPartyIdentifier')
            self.BuyerPartyIdentifier = BuyerPartyIdentifier_
            self.validate_genericStringType1_48(self.BuyerPartyIdentifier)    # validate type genericStringType1_48
        elif nodeName_ == 'BuyerOrganisationName':
            BuyerOrganisationName_ = child_.text
            BuyerOrganisationName_ = self.gds_validate_string(BuyerOrganisationName_, node, 'BuyerOrganisationName')
            self.BuyerOrganisationName = BuyerOrganisationName_
            self.validate_genericStringType2_70(self.BuyerOrganisationName)    # validate type genericStringType2_70
        elif nodeName_ == 'BuyerPostalAddressDetails':
            obj_ = BuyerPostalAddressDetailsType.factory()
            obj_.build(child_)
            self.BuyerPostalAddressDetails = obj_
            obj_.original_tagname_ = 'BuyerPostalAddressDetails'
# end class BuyerPartyDetailsType


class BuyerPostalAddressDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, BuyerStreetName=None, BuyerTownName=None, BuyerPostCodeIdentifier=None, CountryCode=None, CountryName=None, BuyerPostOfficeBoxIdentifier=None):
        self.original_tagname_ = None
        self.BuyerStreetName = BuyerStreetName
        self.BuyerTownName = BuyerTownName
        self.BuyerPostCodeIdentifier = BuyerPostCodeIdentifier
        self.CountryCode = CountryCode
        self.CountryName = CountryName
        self.BuyerPostOfficeBoxIdentifier = BuyerPostOfficeBoxIdentifier
    def factory(*args_, **kwargs_):
        if BuyerPostalAddressDetailsType.subclass:
            return BuyerPostalAddressDetailsType.subclass(*args_, **kwargs_)
        else:
            return BuyerPostalAddressDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_BuyerStreetName(self): return self.BuyerStreetName
    def set_BuyerStreetName(self, BuyerStreetName): self.BuyerStreetName = BuyerStreetName
    def get_BuyerTownName(self): return self.BuyerTownName
    def set_BuyerTownName(self, BuyerTownName): self.BuyerTownName = BuyerTownName
    def get_BuyerPostCodeIdentifier(self): return self.BuyerPostCodeIdentifier
    def set_BuyerPostCodeIdentifier(self, BuyerPostCodeIdentifier): self.BuyerPostCodeIdentifier = BuyerPostCodeIdentifier
    def get_CountryCode(self): return self.CountryCode
    def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode
    def get_CountryName(self): return self.CountryName
    def set_CountryName(self, CountryName): self.CountryName = CountryName
    def get_BuyerPostOfficeBoxIdentifier(self): return self.BuyerPostOfficeBoxIdentifier
    def set_BuyerPostOfficeBoxIdentifier(self, BuyerPostOfficeBoxIdentifier): self.BuyerPostOfficeBoxIdentifier = BuyerPostOfficeBoxIdentifier
    def validate_genericStringType2_35(self, value):
        # Validate type genericStringType2_35, a restriction on xs:string.
        pass
    def validate_genericStringType1_48(self, value):
        # Validate type genericStringType1_48, a restriction on xs:string.
        pass
    def validate_CountryCodeType(self, value):
        # Validate type CountryCodeType, a restriction on xs:NMTOKEN.
        pass
    def hasContent_(self):
        if (
            self.BuyerStreetName is not None or
            self.BuyerTownName is not None or
            self.BuyerPostCodeIdentifier is not None or
            self.CountryCode is not None or
            self.CountryName is not None or
            self.BuyerPostOfficeBoxIdentifier is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='BuyerPostalAddressDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='BuyerPostalAddressDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='BuyerPostalAddressDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='BuyerPostalAddressDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='BuyerPostalAddressDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.BuyerStreetName is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sBuyerStreetName>%s</%sBuyerStreetName>%s' % (namespace_, self.gds_format_string(quote_xml(self.BuyerStreetName).encode(ExternalEncoding), input_name='BuyerStreetName'), namespace_, eol_))
        if self.BuyerTownName is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sBuyerTownName>%s</%sBuyerTownName>%s' % (namespace_, self.gds_format_string(quote_xml(self.BuyerTownName).encode(ExternalEncoding), input_name='BuyerTownName'), namespace_, eol_))
        if self.BuyerPostCodeIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sBuyerPostCodeIdentifier>%s</%sBuyerPostCodeIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.BuyerPostCodeIdentifier).encode(ExternalEncoding), input_name='BuyerPostCodeIdentifier'), namespace_, eol_))
        if self.CountryCode is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sCountryCode>%s</%sCountryCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_, eol_))
        if self.CountryName is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sCountryName>%s</%sCountryName>%s' % (namespace_, self.gds_format_string(quote_xml(self.CountryName).encode(ExternalEncoding), input_name='CountryName'), namespace_, eol_))
        if self.BuyerPostOfficeBoxIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sBuyerPostOfficeBoxIdentifier>%s</%sBuyerPostOfficeBoxIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.BuyerPostOfficeBoxIdentifier).encode(ExternalEncoding), input_name='BuyerPostOfficeBoxIdentifier'), namespace_, eol_))
    def exportLiteral(self, outfile, level, name_='BuyerPostalAddressDetailsType'):
        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.BuyerStreetName is not None:
            showIndent(outfile, level)
            outfile.write('BuyerStreetName=%s,\n' % quote_python(self.BuyerStreetName).encode(ExternalEncoding))
        if self.BuyerTownName is not None:
            showIndent(outfile, level)
            outfile.write('BuyerTownName=%s,\n' % quote_python(self.BuyerTownName).encode(ExternalEncoding))
        if self.BuyerPostCodeIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('BuyerPostCodeIdentifier=%s,\n' % quote_python(self.BuyerPostCodeIdentifier).encode(ExternalEncoding))
        if self.CountryCode is not None:
            showIndent(outfile, level)
            outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding))
        if self.CountryName is not None:
            showIndent(outfile, level)
            outfile.write('CountryName=%s,\n' % quote_python(self.CountryName).encode(ExternalEncoding))
        if self.BuyerPostOfficeBoxIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('BuyerPostOfficeBoxIdentifier=%s,\n' % quote_python(self.BuyerPostOfficeBoxIdentifier).encode(ExternalEncoding))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'BuyerStreetName':
            BuyerStreetName_ = child_.text
            BuyerStreetName_ = self.gds_validate_string(BuyerStreetName_, node, 'BuyerStreetName')
            self.BuyerStreetName = BuyerStreetName_
            self.validate_genericStringType2_35(self.BuyerStreetName)    # validate type genericStringType2_35
        elif nodeName_ == 'BuyerTownName':
            BuyerTownName_ = child_.text
            BuyerTownName_ = self.gds_validate_string(BuyerTownName_, node, 'BuyerTownName')
            self.BuyerTownName = BuyerTownName_
            self.validate_genericStringType2_35(self.BuyerTownName)    # validate type genericStringType2_35
        elif nodeName_ == 'BuyerPostCodeIdentifier':
            BuyerPostCodeIdentifier_ = child_.text
            BuyerPostCodeIdentifier_ = self.gds_validate_string(BuyerPostCodeIdentifier_, node, 'BuyerPostCodeIdentifier')
            self.BuyerPostCodeIdentifier = BuyerPostCodeIdentifier_
            self.validate_genericStringType1_48(self.BuyerPostCodeIdentifier)    # validate type genericStringType1_48
        elif nodeName_ == 'CountryCode':
            CountryCode_ = child_.text
            CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode')
            self.CountryCode = CountryCode_
            self.validate_CountryCodeType(self.CountryCode)    # validate type CountryCodeType
        elif nodeName_ == 'CountryName':
            CountryName_ = child_.text
            CountryName_ = self.gds_validate_string(CountryName_, node, 'CountryName')
            self.CountryName = CountryName_
            self.validate_genericStringType2_35(self.CountryName)    # validate type genericStringType2_35
        elif nodeName_ == 'BuyerPostOfficeBoxIdentifier':
            BuyerPostOfficeBoxIdentifier_ = child_.text
            BuyerPostOfficeBoxIdentifier_ = self.gds_validate_string(BuyerPostOfficeBoxIdentifier_, node, 'BuyerPostOfficeBoxIdentifier')
            self.BuyerPostOfficeBoxIdentifier = BuyerPostOfficeBoxIdentifier_
            self.validate_genericStringType1_48(self.BuyerPostOfficeBoxIdentifier)    # validate type genericStringType1_48
# end class BuyerPostalAddressDetailsType


class ConversionDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, ConversionID=None):
        self.original_tagname_ = None
        self.ConversionID = ConversionID
    def factory(*args_, **kwargs_):
        if ConversionDetailsType.subclass:
            return ConversionDetailsType.subclass(*args_, **kwargs_)
        else:
            return ConversionDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_ConversionID(self): return self.ConversionID
    def set_ConversionID(self, ConversionID): self.ConversionID = ConversionID
    def validate_genericStringType0_30(self, value):
        # Validate type genericStringType0_30, a restriction on xs:string.
        pass
    def hasContent_(self):
        if (
            self.ConversionID is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='ConversionDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='ConversionDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='ConversionDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='ConversionDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='ConversionDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.ConversionID is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sConversionID>%s</%sConversionID>%s' % (namespace_, self.gds_format_string(quote_xml(self.ConversionID).encode(ExternalEncoding), input_name='ConversionID'), namespace_, eol_))
    def exportLiteral(self, outfile, level, name_='ConversionDetailsType'):
        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.ConversionID is not None:
            showIndent(outfile, level)
            outfile.write('ConversionID=%s,\n' % quote_python(self.ConversionID).encode(ExternalEncoding))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'ConversionID':
            ConversionID_ = child_.text
            ConversionID_ = self.gds_validate_string(ConversionID_, node, 'ConversionID')
            self.ConversionID = ConversionID_
            self.validate_genericStringType0_30(self.ConversionID)    # validate type genericStringType0_30
# end class ConversionDetailsType


class InvoiceRecipientDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, InvoiceRecipientAddress=None, InvoiceRecipientIntermediatorAddress=None, SellerInvoiceIdentifier=None, EpiRemittanceIdentifier=None, InvoiceRecipientLanguageCode=None):
        self.original_tagname_ = None
        self.InvoiceRecipientAddress = InvoiceRecipientAddress
        self.InvoiceRecipientIntermediatorAddress = InvoiceRecipientIntermediatorAddress
        if SellerInvoiceIdentifier is None:
            self.SellerInvoiceIdentifier = []
        else:
            self.SellerInvoiceIdentifier = SellerInvoiceIdentifier
        self.EpiRemittanceIdentifier = EpiRemittanceIdentifier
        self.InvoiceRecipientLanguageCode = InvoiceRecipientLanguageCode
    def factory(*args_, **kwargs_):
        if InvoiceRecipientDetailsType.subclass:
            return InvoiceRecipientDetailsType.subclass(*args_, **kwargs_)
        else:
            return InvoiceRecipientDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_InvoiceRecipientAddress(self): return self.InvoiceRecipientAddress
    def set_InvoiceRecipientAddress(self, InvoiceRecipientAddress): self.InvoiceRecipientAddress = InvoiceRecipientAddress
    def get_InvoiceRecipientIntermediatorAddress(self): return self.InvoiceRecipientIntermediatorAddress
    def set_InvoiceRecipientIntermediatorAddress(self, InvoiceRecipientIntermediatorAddress): self.InvoiceRecipientIntermediatorAddress = InvoiceRecipientIntermediatorAddress
    def get_SellerInvoiceIdentifier(self): return self.SellerInvoiceIdentifier
    def set_SellerInvoiceIdentifier(self, SellerInvoiceIdentifier): self.SellerInvoiceIdentifier = SellerInvoiceIdentifier
    def add_SellerInvoiceIdentifier(self, value): self.SellerInvoiceIdentifier.append(value)
    def insert_SellerInvoiceIdentifier_at(self, index, value): self.SellerInvoiceIdentifier.insert(index, value)
    def replace_SellerInvoiceIdentifier_at(self, index, value): self.SellerInvoiceIdentifier[index] = value
    def get_EpiRemittanceIdentifier(self): return self.EpiRemittanceIdentifier
    def set_EpiRemittanceIdentifier(self, EpiRemittanceIdentifier): self.EpiRemittanceIdentifier = EpiRemittanceIdentifier
    def get_InvoiceRecipientLanguageCode(self): return self.InvoiceRecipientLanguageCode
    def set_InvoiceRecipientLanguageCode(self, InvoiceRecipientLanguageCode): self.InvoiceRecipientLanguageCode = InvoiceRecipientLanguageCode
    def validate_genericStringType0_35(self, value):
        # Validate type genericStringType0_35, a restriction on xs:string.
        pass
    def validate_genericNMtokenType8_11(self, value):
        # Validate type genericNMtokenType8_11, a restriction on genericNMtokenType.
        pass
    def validate_genericStringType2_35(self, value):
        # Validate type genericStringType2_35, a restriction on xs:string.
        pass
    def validate_LanguageCodeType(self, value):
        # Validate type LanguageCodeType, a restriction on xs:NMTOKEN.
        pass
    def hasContent_(self):
        if (
            self.InvoiceRecipientAddress is not None or
            self.InvoiceRecipientIntermediatorAddress is not None or
            self.SellerInvoiceIdentifier or
            self.EpiRemittanceIdentifier is not None or
            self.InvoiceRecipientLanguageCode is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='InvoiceRecipientDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='InvoiceRecipientDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='InvoiceRecipientDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='InvoiceRecipientDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='InvoiceRecipientDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.InvoiceRecipientAddress is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sInvoiceRecipientAddress>%s</%sInvoiceRecipientAddress>%s' % (namespace_, self.gds_format_string(quote_xml(self.InvoiceRecipientAddress).encode(ExternalEncoding), input_name='InvoiceRecipientAddress'), namespace_, eol_))
        if self.InvoiceRecipientIntermediatorAddress is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sInvoiceRecipientIntermediatorAddress>%s</%sInvoiceRecipientIntermediatorAddress>%s' % (namespace_, self.gds_format_string(quote_xml(self.InvoiceRecipientIntermediatorAddress).encode(ExternalEncoding), input_name='InvoiceRecipientIntermediatorAddress'), namespace_, eol_))
        for SellerInvoiceIdentifier_ in self.SellerInvoiceIdentifier:
            SellerInvoiceIdentifier_.export(outfile, level, namespace_, name_='SellerInvoiceIdentifier', pretty_print=pretty_print)
        if self.EpiRemittanceIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sEpiRemittanceIdentifier>%s</%sEpiRemittanceIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.EpiRemittanceIdentifier).encode(ExternalEncoding), input_name='EpiRemittanceIdentifier'), namespace_, eol_))
        if self.InvoiceRecipientLanguageCode is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sInvoiceRecipientLanguageCode>%s</%sInvoiceRecipientLanguageCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.InvoiceRecipientLanguageCode).encode(ExternalEncoding), input_name='InvoiceRecipientLanguageCode'), namespace_, eol_))
    def exportLiteral(self, outfile, level, name_='InvoiceRecipientDetailsType'):
        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.InvoiceRecipientAddress is not None:
            showIndent(outfile, level)
            outfile.write('InvoiceRecipientAddress=%s,\n' % quote_python(self.InvoiceRecipientAddress).encode(ExternalEncoding))
        if self.InvoiceRecipientIntermediatorAddress is not None:
            showIndent(outfile, level)
            outfile.write('InvoiceRecipientIntermediatorAddress=%s,\n' % quote_python(self.InvoiceRecipientIntermediatorAddress).encode(ExternalEncoding))
        showIndent(outfile, level)
        outfile.write('SellerInvoiceIdentifier=[\n')
        level += 1
        for SellerInvoiceIdentifier_ in self.SellerInvoiceIdentifier:
            showIndent(outfile, level)
            outfile.write('model_.SellerInvoiceIdentifierType(\n')
            SellerInvoiceIdentifier_.exportLiteral(outfile, level, name_='SellerInvoiceIdentifierType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.EpiRemittanceIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('EpiRemittanceIdentifier=%s,\n' % quote_python(self.EpiRemittanceIdentifier).encode(ExternalEncoding))
        if self.InvoiceRecipientLanguageCode is not None:
            showIndent(outfile, level)
            outfile.write('InvoiceRecipientLanguageCode=%s,\n' % quote_python(self.InvoiceRecipientLanguageCode).encode(ExternalEncoding))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'InvoiceRecipientAddress':
            InvoiceRecipientAddress_ = child_.text
            InvoiceRecipientAddress_ = self.gds_validate_string(InvoiceRecipientAddress_, node, 'InvoiceRecipientAddress')
            self.InvoiceRecipientAddress = InvoiceRecipientAddress_
            self.validate_genericStringType0_35(self.InvoiceRecipientAddress)    # validate type genericStringType0_35
        elif nodeName_ == 'InvoiceRecipientIntermediatorAddress':
            InvoiceRecipientIntermediatorAddress_ = child_.text
            InvoiceRecipientIntermediatorAddress_ = re_.sub(String_cleanup_pat_, " ", InvoiceRecipientIntermediatorAddress_).strip()
            InvoiceRecipientIntermediatorAddress_ = self.gds_validate_string(InvoiceRecipientIntermediatorAddress_, node, 'InvoiceRecipientIntermediatorAddress')
            self.InvoiceRecipientIntermediatorAddress = InvoiceRecipientIntermediatorAddress_
            self.validate_genericNMtokenType8_11(self.InvoiceRecipientIntermediatorAddress)    # validate type genericNMtokenType8_11
        elif nodeName_ == 'SellerInvoiceIdentifier':
            obj_ = SellerInvoiceIdentifierType.factory()
            obj_.build(child_)
            self.SellerInvoiceIdentifier.append(obj_)
            obj_.original_tagname_ = 'SellerInvoiceIdentifier'
        elif nodeName_ == 'EpiRemittanceIdentifier':
            EpiRemittanceIdentifier_ = child_.text
            EpiRemittanceIdentifier_ = self.gds_validate_string(EpiRemittanceIdentifier_, node, 'EpiRemittanceIdentifier')
            self.EpiRemittanceIdentifier = EpiRemittanceIdentifier_
            self.validate_genericStringType2_35(self.EpiRemittanceIdentifier)    # validate type genericStringType2_35
        elif nodeName_ == 'InvoiceRecipientLanguageCode':
            InvoiceRecipientLanguageCode_ = child_.text
            InvoiceRecipientLanguageCode_ = self.gds_validate_string(InvoiceRecipientLanguageCode_, node, 'InvoiceRecipientLanguageCode')
            self.InvoiceRecipientLanguageCode = InvoiceRecipientLanguageCode_
            self.validate_LanguageCodeType(self.InvoiceRecipientLanguageCode)    # validate type LanguageCodeType
# end class InvoiceRecipientDetailsType


class InvoiceSenderInformationDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, SellerWebaddressNameText=None, SellerWebaddressText=None, InvoiceSenderAddress=None, InvoiceSenderIntermediatorAddress=None):
        self.original_tagname_ = None
        self.SellerWebaddressNameText = SellerWebaddressNameText
        self.SellerWebaddressText = SellerWebaddressText
        self.InvoiceSenderAddress = InvoiceSenderAddress
        self.InvoiceSenderIntermediatorAddress = InvoiceSenderIntermediatorAddress
    def factory(*args_, **kwargs_):
        if InvoiceSenderInformationDetailsType.subclass:
            return InvoiceSenderInformationDetailsType.subclass(*args_, **kwargs_)
        else:
            return InvoiceSenderInformationDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SellerWebaddressNameText(self): return self.SellerWebaddressNameText
    def set_SellerWebaddressNameText(self, SellerWebaddressNameText): self.SellerWebaddressNameText = SellerWebaddressNameText
    def get_SellerWebaddressText(self): return self.SellerWebaddressText
    def set_SellerWebaddressText(self, SellerWebaddressText): self.SellerWebaddressText = SellerWebaddressText
    def get_InvoiceSenderAddress(self): return self.InvoiceSenderAddress
    def set_InvoiceSenderAddress(self, InvoiceSenderAddress): self.InvoiceSenderAddress = InvoiceSenderAddress
    def get_InvoiceSenderIntermediatorAddress(self): return self.InvoiceSenderIntermediatorAddress
    def set_InvoiceSenderIntermediatorAddress(self, InvoiceSenderIntermediatorAddress): self.InvoiceSenderIntermediatorAddress = InvoiceSenderIntermediatorAddress
    def validate_genericStringType0_70(self, value):
        # Validate type genericStringType0_70, a restriction on xs:string.
        pass
    def validate_genericStringType0_512(self, value):
        # Validate type genericStringType0_512, a restriction on xs:string.
        pass
    def validate_genericStringType0_35(self, value):
        # Validate type genericStringType0_35, a restriction on xs:string.
        pass
    def validate_genericNMtokenType8_11(self, value):
        # Validate type genericNMtokenType8_11, a restriction on genericNMtokenType.
        pass
    def hasContent_(self):
        if (
            self.SellerWebaddressNameText is not None or
            self.SellerWebaddressText is not None or
            self.InvoiceSenderAddress is not None or
            self.InvoiceSenderIntermediatorAddress is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='InvoiceSenderInformationDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='InvoiceSenderInformationDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='InvoiceSenderInformationDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='InvoiceSenderInformationDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='InvoiceSenderInformationDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.SellerWebaddressNameText is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerWebaddressNameText>%s</%sSellerWebaddressNameText>%s' % (namespace_, self.gds_format_string(quote_xml(self.SellerWebaddressNameText).encode(ExternalEncoding), input_name='SellerWebaddressNameText'), namespace_, eol_))
        if self.SellerWebaddressText is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerWebaddressText>%s</%sSellerWebaddressText>%s' % (namespace_, self.gds_format_string(quote_xml(self.SellerWebaddressText).encode(ExternalEncoding), input_name='SellerWebaddressText'), namespace_, eol_))
        if self.InvoiceSenderAddress is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sInvoiceSenderAddress>%s</%sInvoiceSenderAddress>%s' % (namespace_, self.gds_format_string(quote_xml(self.InvoiceSenderAddress).encode(ExternalEncoding), input_name='InvoiceSenderAddress'), namespace_, eol_))
        if self.InvoiceSenderIntermediatorAddress is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sInvoiceSenderIntermediatorAddress>%s</%sInvoiceSenderIntermediatorAddress>%s' % (namespace_, self.gds_format_string(quote_xml(self.InvoiceSenderIntermediatorAddress).encode(ExternalEncoding), input_name='InvoiceSenderIntermediatorAddress'), namespace_, eol_))
    def exportLiteral(self, outfile, level, name_='InvoiceSenderInformationDetailsType'):
        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.SellerWebaddressNameText is not None:
            showIndent(outfile, level)
            outfile.write('SellerWebaddressNameText=%s,\n' % quote_python(self.SellerWebaddressNameText).encode(ExternalEncoding))
        if self.SellerWebaddressText is not None:
            showIndent(outfile, level)
            outfile.write('SellerWebaddressText=%s,\n' % quote_python(self.SellerWebaddressText).encode(ExternalEncoding))
        if self.InvoiceSenderAddress is not None:
            showIndent(outfile, level)
            outfile.write('InvoiceSenderAddress=%s,\n' % quote_python(self.InvoiceSenderAddress).encode(ExternalEncoding))
        if self.InvoiceSenderIntermediatorAddress is not None:
            showIndent(outfile, level)
            outfile.write('InvoiceSenderIntermediatorAddress=%s,\n' % quote_python(self.InvoiceSenderIntermediatorAddress).encode(ExternalEncoding))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SellerWebaddressNameText':
            SellerWebaddressNameText_ = child_.text
            SellerWebaddressNameText_ = self.gds_validate_string(SellerWebaddressNameText_, node, 'SellerWebaddressNameText')
            self.SellerWebaddressNameText = SellerWebaddressNameText_
            self.validate_genericStringType0_70(self.SellerWebaddressNameText)    # validate type genericStringType0_70
        elif nodeName_ == 'SellerWebaddressText':
            SellerWebaddressText_ = child_.text
            SellerWebaddressText_ = self.gds_validate_string(SellerWebaddressText_, node, 'SellerWebaddressText')
            self.SellerWebaddressText = SellerWebaddressText_
            self.validate_genericStringType0_512(self.SellerWebaddressText)    # validate type genericStringType0_512
        elif nodeName_ == 'InvoiceSenderAddress':
            InvoiceSenderAddress_ = child_.text
            InvoiceSenderAddress_ = self.gds_validate_string(InvoiceSenderAddress_, node, 'InvoiceSenderAddress')
            self.InvoiceSenderAddress = InvoiceSenderAddress_
            self.validate_genericStringType0_35(self.InvoiceSenderAddress)    # validate type genericStringType0_35
        elif nodeName_ == 'InvoiceSenderIntermediatorAddress':
            InvoiceSenderIntermediatorAddress_ = child_.text
            InvoiceSenderIntermediatorAddress_ = re_.sub(String_cleanup_pat_, " ", InvoiceSenderIntermediatorAddress_).strip()
            InvoiceSenderIntermediatorAddress_ = self.gds_validate_string(InvoiceSenderIntermediatorAddress_, node, 'InvoiceSenderIntermediatorAddress')
            self.InvoiceSenderIntermediatorAddress = InvoiceSenderIntermediatorAddress_
            self.validate_genericNMtokenType8_11(self.InvoiceSenderIntermediatorAddress)    # validate type genericNMtokenType8_11
# end class InvoiceSenderInformationDetailsType


class MessageDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, MessageTypeCode=None, MessageTypeText=None, MessageActionCode=None, MessageActionCodeIdentifier=None, MessageDate=None, SenderInfoIdentifier=None):
        self.original_tagname_ = None
        self.MessageTypeCode = MessageTypeCode
        self.MessageTypeText = MessageTypeText
        self.MessageActionCode = MessageActionCode
        self.MessageActionCodeIdentifier = MessageActionCodeIdentifier
        self.MessageDate = MessageDate
        self.SenderInfoIdentifier = SenderInfoIdentifier
    def factory(*args_, **kwargs_):
        if MessageDetailsType.subclass:
            return MessageDetailsType.subclass(*args_, **kwargs_)
        else:
            return MessageDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_MessageTypeCode(self): return self.MessageTypeCode
    def set_MessageTypeCode(self, MessageTypeCode): self.MessageTypeCode = MessageTypeCode
    def get_MessageTypeText(self): return self.MessageTypeText
    def set_MessageTypeText(self, MessageTypeText): self.MessageTypeText = MessageTypeText
    def get_MessageActionCode(self): return self.MessageActionCode
    def set_MessageActionCode(self, MessageActionCode): self.MessageActionCode = MessageActionCode
    def get_MessageActionCodeIdentifier(self): return self.MessageActionCodeIdentifier
    def set_MessageActionCodeIdentifier(self, MessageActionCodeIdentifier): self.MessageActionCodeIdentifier = MessageActionCodeIdentifier
    def get_MessageDate(self): return self.MessageDate
    def set_MessageDate(self, MessageDate): self.MessageDate = MessageDate
    def get_SenderInfoIdentifier(self): return self.SenderInfoIdentifier
    def set_SenderInfoIdentifier(self, SenderInfoIdentifier): self.SenderInfoIdentifier = SenderInfoIdentifier
    def validate_genericStringType0_35(self, value):
        # Validate type genericStringType0_35, a restriction on xs:string.
        pass
    def validate_MessageActionCodeType(self, value):
        # Validate type MessageActionCodeType, a restriction on xs:string.
        pass
    def validate_MessageActionCodeIdentifierType(self, value):
        # Validate type MessageActionCodeIdentifierType, a restriction on xs:NMTOKEN.
        pass
    def validate_genericStringType1_48(self, value):
        # Validate type genericStringType1_48, a restriction on xs:string.
        pass
    def hasContent_(self):
        if (
            self.MessageTypeCode is not None or
            self.MessageTypeText is not None or
            self.MessageActionCode is not None or
            self.MessageActionCodeIdentifier is not None or
            self.MessageDate is not None or
            self.SenderInfoIdentifier is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='MessageDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='MessageDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='MessageDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='MessageDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='MessageDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.MessageTypeCode is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sMessageTypeCode>%s</%sMessageTypeCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.MessageTypeCode).encode(ExternalEncoding), input_name='MessageTypeCode'), namespace_, eol_))
        if self.MessageTypeText is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sMessageTypeText>%s</%sMessageTypeText>%s' % (namespace_, self.gds_format_string(quote_xml(self.MessageTypeText).encode(ExternalEncoding), input_name='MessageTypeText'), namespace_, eol_))
        if self.MessageActionCode is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sMessageActionCode>%s</%sMessageActionCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.MessageActionCode).encode(ExternalEncoding), input_name='MessageActionCode'), namespace_, eol_))
        if self.MessageActionCodeIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sMessageActionCodeIdentifier>%s</%sMessageActionCodeIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.MessageActionCodeIdentifier).encode(ExternalEncoding), input_name='MessageActionCodeIdentifier'), namespace_, eol_))
        if self.MessageDate is not None:
            self.MessageDate.export(outfile, level, namespace_, name_='MessageDate', pretty_print=pretty_print)
        if self.SenderInfoIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSenderInfoIdentifier>%s</%sSenderInfoIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.SenderInfoIdentifier).encode(ExternalEncoding), input_name='SenderInfoIdentifier'), namespace_, eol_))
    def exportLiteral(self, outfile, level, name_='MessageDetailsType'):
        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.MessageTypeCode is not None:
            showIndent(outfile, level)
            outfile.write('MessageTypeCode=%s,\n' % quote_python(self.MessageTypeCode).encode(ExternalEncoding))
        if self.MessageTypeText is not None:
            showIndent(outfile, level)
            outfile.write('MessageTypeText=%s,\n' % quote_python(self.MessageTypeText).encode(ExternalEncoding))
        if self.MessageActionCode is not None:
            showIndent(outfile, level)
            outfile.write('MessageActionCode=%s,\n' % quote_python(self.MessageActionCode).encode(ExternalEncoding))
        if self.MessageActionCodeIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('MessageActionCodeIdentifier=%s,\n' % quote_python(self.MessageActionCodeIdentifier).encode(ExternalEncoding))
        if self.MessageDate is not None:
            showIndent(outfile, level)
            outfile.write('MessageDate=model_.date(\n')
            self.MessageDate.exportLiteral(outfile, level, name_='MessageDate')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.SenderInfoIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('SenderInfoIdentifier=%s,\n' % quote_python(self.SenderInfoIdentifier).encode(ExternalEncoding))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'MessageTypeCode':
            MessageTypeCode_ = child_.text
            MessageTypeCode_ = self.gds_validate_string(MessageTypeCode_, node, 'MessageTypeCode')
            self.MessageTypeCode = MessageTypeCode_
        elif nodeName_ == 'MessageTypeText':
            MessageTypeText_ = child_.text
            MessageTypeText_ = self.gds_validate_string(MessageTypeText_, node, 'MessageTypeText')
            self.MessageTypeText = MessageTypeText_
            self.validate_genericStringType0_35(self.MessageTypeText)    # validate type genericStringType0_35
        elif nodeName_ == 'MessageActionCode':
            MessageActionCode_ = child_.text
            MessageActionCode_ = self.gds_validate_string(MessageActionCode_, node, 'MessageActionCode')
            self.MessageActionCode = MessageActionCode_
            self.validate_MessageActionCodeType(self.MessageActionCode)    # validate type MessageActionCodeType
        elif nodeName_ == 'MessageActionCodeIdentifier':
            MessageActionCodeIdentifier_ = child_.text
            MessageActionCodeIdentifier_ = self.gds_validate_string(MessageActionCodeIdentifier_, node, 'MessageActionCodeIdentifier')
            self.MessageActionCodeIdentifier = MessageActionCodeIdentifier_
            self.validate_MessageActionCodeIdentifierType(self.MessageActionCodeIdentifier)    # validate type MessageActionCodeIdentifierType
        elif nodeName_ == 'MessageDate':
            obj_ = date.factory()
            obj_.build(child_)
            self.MessageDate = obj_
            obj_.original_tagname_ = 'MessageDate'
        elif nodeName_ == 'SenderInfoIdentifier':
            SenderInfoIdentifier_ = child_.text
            SenderInfoIdentifier_ = self.gds_validate_string(SenderInfoIdentifier_, node, 'SenderInfoIdentifier')
            self.SenderInfoIdentifier = SenderInfoIdentifier_
            self.validate_genericStringType1_48(self.SenderInfoIdentifier)    # validate type genericStringType1_48
# end class MessageDetailsType


class SellerAccountDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, SellerAccountID=None, SellerBic=None):
        self.original_tagname_ = None
        self.SellerAccountID = SellerAccountID
        self.SellerBic = SellerBic
    def factory(*args_, **kwargs_):
        if SellerAccountDetailsType.subclass:
            return SellerAccountDetailsType.subclass(*args_, **kwargs_)
        else:
            return SellerAccountDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SellerAccountID(self): return self.SellerAccountID
    def set_SellerAccountID(self, SellerAccountID): self.SellerAccountID = SellerAccountID
    def get_SellerBic(self): return self.SellerBic
    def set_SellerBic(self, SellerBic): self.SellerBic = SellerBic
    def hasContent_(self):
        if (
            self.SellerAccountID is not None or
            self.SellerBic is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerAccountDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerAccountDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerAccountDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerAccountDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='SellerAccountDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.SellerAccountID is not None:
            self.SellerAccountID.export(outfile, level, namespace_, name_='SellerAccountID', pretty_print=pretty_print)
        if self.SellerBic is not None:
            self.SellerBic.export(outfile, level, namespace_, name_='SellerBic', pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='SellerAccountDetailsType'):
        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.SellerAccountID is not None:
            showIndent(outfile, level)
            outfile.write('SellerAccountID=model_.SellerAccountIDType1(\n')
            self.SellerAccountID.exportLiteral(outfile, level, name_='SellerAccountID')
            showIndent(outfile, level)
            outfile.write('),\n')
        if self.SellerBic is not None:
            showIndent(outfile, level)
            outfile.write('SellerBic=model_.SellerBicType2(\n')
            self.SellerBic.exportLiteral(outfile, level, name_='SellerBic')
            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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SellerAccountID':
            obj_ = SellerAccountIDType1.factory()
            obj_.build(child_)
            self.SellerAccountID = obj_
            obj_.original_tagname_ = 'SellerAccountID'
        elif nodeName_ == 'SellerBic':
            obj_ = SellerBicType2.factory()
            obj_.build(child_)
            self.SellerBic = obj_
            obj_.original_tagname_ = 'SellerBic'
# end class SellerAccountDetailsType


class SellerAccountIDType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, IdentificationSchemeName=None, valueOf_=None, extensiontype_=None):
        self.original_tagname_ = None
        self.IdentificationSchemeName = _cast(None, IdentificationSchemeName)
        self.valueOf_ = valueOf_
        self.extensiontype_ = extensiontype_
    def factory(*args_, **kwargs_):
        if SellerAccountIDType.subclass:
            return SellerAccountIDType.subclass(*args_, **kwargs_)
        else:
            return SellerAccountIDType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_IdentificationSchemeName(self): return self.IdentificationSchemeName
    def set_IdentificationSchemeName(self, IdentificationSchemeName): self.IdentificationSchemeName = IdentificationSchemeName
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_extensiontype_(self): return self.extensiontype_
    def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerAccountIDType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerAccountIDType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerAccountIDType', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerAccountIDType'):
        if self.IdentificationSchemeName is not None and 'IdentificationSchemeName' not in already_processed:
            already_processed.add('IdentificationSchemeName')
            outfile.write(' IdentificationSchemeName=%s' % (self.gds_format_string(quote_attrib(self.IdentificationSchemeName).encode(ExternalEncoding), input_name='IdentificationSchemeName'), ))
        if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
            outfile.write(' xsi:type="%s"' % self.extensiontype_)
    def exportChildren(self, outfile, level, namespace_='', name_='SellerAccountIDType', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='SellerAccountIDType'):
        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.IdentificationSchemeName is not None and 'IdentificationSchemeName' not in already_processed:
            already_processed.add('IdentificationSchemeName')
            showIndent(outfile, level)
            outfile.write('IdentificationSchemeName="%s",\n' % (self.IdentificationSchemeName,))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('IdentificationSchemeName', node)
        if value is not None and 'IdentificationSchemeName' not in already_processed:
            already_processed.add('IdentificationSchemeName')
            self.IdentificationSchemeName = value
        value = find_attr_value_('xsi:type', node)
        if value is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            self.extensiontype_ = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class SellerAccountIDType


class SellerBicType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, IdentificationSchemeName=None, valueOf_=None, extensiontype_=None):
        self.original_tagname_ = None
        self.IdentificationSchemeName = _cast(None, IdentificationSchemeName)
        self.valueOf_ = valueOf_
        self.extensiontype_ = extensiontype_
    def factory(*args_, **kwargs_):
        if SellerBicType.subclass:
            return SellerBicType.subclass(*args_, **kwargs_)
        else:
            return SellerBicType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_IdentificationSchemeName(self): return self.IdentificationSchemeName
    def set_IdentificationSchemeName(self, IdentificationSchemeName): self.IdentificationSchemeName = IdentificationSchemeName
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_extensiontype_(self): return self.extensiontype_
    def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerBicType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerBicType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerBicType', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerBicType'):
        if self.IdentificationSchemeName is not None and 'IdentificationSchemeName' not in already_processed:
            already_processed.add('IdentificationSchemeName')
            outfile.write(' IdentificationSchemeName=%s' % (self.gds_format_string(quote_attrib(self.IdentificationSchemeName).encode(ExternalEncoding), input_name='IdentificationSchemeName'), ))
        if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
            outfile.write(' xsi:type="%s"' % self.extensiontype_)
    def exportChildren(self, outfile, level, namespace_='', name_='SellerBicType', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='SellerBicType'):
        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.IdentificationSchemeName is not None and 'IdentificationSchemeName' not in already_processed:
            already_processed.add('IdentificationSchemeName')
            showIndent(outfile, level)
            outfile.write('IdentificationSchemeName="%s",\n' % (self.IdentificationSchemeName,))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('IdentificationSchemeName', node)
        if value is not None and 'IdentificationSchemeName' not in already_processed:
            already_processed.add('IdentificationSchemeName')
            self.IdentificationSchemeName = value
        value = find_attr_value_('xsi:type', node)
        if value is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            self.extensiontype_ = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class SellerBicType


class SellerInvoiceDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, SellerDirectDebitIdentifier=None, PaymentInstructionIdentifier=None, SellerInstructionFreeText=None, SellerInvoiceTypeDetails=None):
        self.original_tagname_ = None
        self.SellerDirectDebitIdentifier = SellerDirectDebitIdentifier
        self.PaymentInstructionIdentifier = PaymentInstructionIdentifier
        if SellerInstructionFreeText is None:
            self.SellerInstructionFreeText = []
        else:
            self.SellerInstructionFreeText = SellerInstructionFreeText
        if SellerInvoiceTypeDetails is None:
            self.SellerInvoiceTypeDetails = []
        else:
            self.SellerInvoiceTypeDetails = SellerInvoiceTypeDetails
    def factory(*args_, **kwargs_):
        if SellerInvoiceDetailsType.subclass:
            return SellerInvoiceDetailsType.subclass(*args_, **kwargs_)
        else:
            return SellerInvoiceDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SellerDirectDebitIdentifier(self): return self.SellerDirectDebitIdentifier
    def set_SellerDirectDebitIdentifier(self, SellerDirectDebitIdentifier): self.SellerDirectDebitIdentifier = SellerDirectDebitIdentifier
    def get_PaymentInstructionIdentifier(self): return self.PaymentInstructionIdentifier
    def set_PaymentInstructionIdentifier(self, PaymentInstructionIdentifier): self.PaymentInstructionIdentifier = PaymentInstructionIdentifier
    def get_SellerInstructionFreeText(self): return self.SellerInstructionFreeText
    def set_SellerInstructionFreeText(self, SellerInstructionFreeText): self.SellerInstructionFreeText = SellerInstructionFreeText
    def add_SellerInstructionFreeText(self, value): self.SellerInstructionFreeText.append(value)
    def insert_SellerInstructionFreeText_at(self, index, value): self.SellerInstructionFreeText.insert(index, value)
    def replace_SellerInstructionFreeText_at(self, index, value): self.SellerInstructionFreeText[index] = value
    def get_SellerInvoiceTypeDetails(self): return self.SellerInvoiceTypeDetails
    def set_SellerInvoiceTypeDetails(self, SellerInvoiceTypeDetails): self.SellerInvoiceTypeDetails = SellerInvoiceTypeDetails
    def add_SellerInvoiceTypeDetails(self, value): self.SellerInvoiceTypeDetails.append(value)
    def insert_SellerInvoiceTypeDetails_at(self, index, value): self.SellerInvoiceTypeDetails.insert(index, value)
    def replace_SellerInvoiceTypeDetails_at(self, index, value): self.SellerInvoiceTypeDetails[index] = value
    def validate_genericStringType0_35(self, value):
        # Validate type genericStringType0_35, a restriction on xs:string.
        pass
    def validate_genericStringType1_35(self, value):
        # Validate type genericStringType1_35, a restriction on xs:string.
        pass
    def hasContent_(self):
        if (
            self.SellerDirectDebitIdentifier is not None or
            self.PaymentInstructionIdentifier is not None or
            self.SellerInstructionFreeText or
            self.SellerInvoiceTypeDetails
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerInvoiceDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerInvoiceDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerInvoiceDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerInvoiceDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='SellerInvoiceDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.SellerDirectDebitIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerDirectDebitIdentifier>%s</%sSellerDirectDebitIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.SellerDirectDebitIdentifier).encode(ExternalEncoding), input_name='SellerDirectDebitIdentifier'), namespace_, eol_))
        if self.PaymentInstructionIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sPaymentInstructionIdentifier>%s</%sPaymentInstructionIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.PaymentInstructionIdentifier).encode(ExternalEncoding), input_name='PaymentInstructionIdentifier'), namespace_, eol_))
        for SellerInstructionFreeText_ in self.SellerInstructionFreeText:
            SellerInstructionFreeText_.export(outfile, level, namespace_, name_='SellerInstructionFreeText', pretty_print=pretty_print)
        for SellerInvoiceTypeDetails_ in self.SellerInvoiceTypeDetails:
            SellerInvoiceTypeDetails_.export(outfile, level, namespace_, name_='SellerInvoiceTypeDetails', pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='SellerInvoiceDetailsType'):
        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.SellerDirectDebitIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('SellerDirectDebitIdentifier=%s,\n' % quote_python(self.SellerDirectDebitIdentifier).encode(ExternalEncoding))
        if self.PaymentInstructionIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('PaymentInstructionIdentifier=%s,\n' % quote_python(self.PaymentInstructionIdentifier).encode(ExternalEncoding))
        showIndent(outfile, level)
        outfile.write('SellerInstructionFreeText=[\n')
        level += 1
        for SellerInstructionFreeText_ in self.SellerInstructionFreeText:
            showIndent(outfile, level)
            outfile.write('model_.SellerInstructionFreeTextType(\n')
            SellerInstructionFreeText_.exportLiteral(outfile, level, name_='SellerInstructionFreeTextType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        showIndent(outfile, level)
        outfile.write('SellerInvoiceTypeDetails=[\n')
        level += 1
        for SellerInvoiceTypeDetails_ in self.SellerInvoiceTypeDetails:
            showIndent(outfile, level)
            outfile.write('model_.SellerInvoiceTypeDetailsType(\n')
            SellerInvoiceTypeDetails_.exportLiteral(outfile, level, name_='SellerInvoiceTypeDetailsType')
            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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SellerDirectDebitIdentifier':
            SellerDirectDebitIdentifier_ = child_.text
            SellerDirectDebitIdentifier_ = self.gds_validate_string(SellerDirectDebitIdentifier_, node, 'SellerDirectDebitIdentifier')
            self.SellerDirectDebitIdentifier = SellerDirectDebitIdentifier_
            self.validate_genericStringType0_35(self.SellerDirectDebitIdentifier)    # validate type genericStringType0_35
        elif nodeName_ == 'PaymentInstructionIdentifier':
            PaymentInstructionIdentifier_ = child_.text
            PaymentInstructionIdentifier_ = self.gds_validate_string(PaymentInstructionIdentifier_, node, 'PaymentInstructionIdentifier')
            self.PaymentInstructionIdentifier = PaymentInstructionIdentifier_
            self.validate_genericStringType1_35(self.PaymentInstructionIdentifier)    # validate type genericStringType1_35
        elif nodeName_ == 'SellerInstructionFreeText':
            obj_ = SellerInstructionFreeTextType.factory()
            obj_.build(child_)
            self.SellerInstructionFreeText.append(obj_)
            obj_.original_tagname_ = 'SellerInstructionFreeText'
        elif nodeName_ == 'SellerInvoiceTypeDetails':
            obj_ = SellerInvoiceTypeDetailsType.factory()
            obj_.build(child_)
            self.SellerInvoiceTypeDetails.append(obj_)
            obj_.original_tagname_ = 'SellerInvoiceTypeDetails'
# end class SellerInvoiceDetailsType


class SellerPartyDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, SellerPartyIdentifier=None, SellerOrganisationNames=None, SellerOrganisationBankName=None, SellerPostalAddressDetails=None):
        self.original_tagname_ = None
        self.SellerPartyIdentifier = SellerPartyIdentifier
        if SellerOrganisationNames is None:
            self.SellerOrganisationNames = []
        else:
            self.SellerOrganisationNames = SellerOrganisationNames
        if SellerOrganisationBankName is None:
            self.SellerOrganisationBankName = []
        else:
            self.SellerOrganisationBankName = SellerOrganisationBankName
        self.SellerPostalAddressDetails = SellerPostalAddressDetails
    def factory(*args_, **kwargs_):
        if SellerPartyDetailsType.subclass:
            return SellerPartyDetailsType.subclass(*args_, **kwargs_)
        else:
            return SellerPartyDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SellerPartyIdentifier(self): return self.SellerPartyIdentifier
    def set_SellerPartyIdentifier(self, SellerPartyIdentifier): self.SellerPartyIdentifier = SellerPartyIdentifier
    def get_SellerOrganisationNames(self): return self.SellerOrganisationNames
    def set_SellerOrganisationNames(self, SellerOrganisationNames): self.SellerOrganisationNames = SellerOrganisationNames
    def add_SellerOrganisationNames(self, value): self.SellerOrganisationNames.append(value)
    def insert_SellerOrganisationNames_at(self, index, value): self.SellerOrganisationNames.insert(index, value)
    def replace_SellerOrganisationNames_at(self, index, value): self.SellerOrganisationNames[index] = value
    def get_SellerOrganisationBankName(self): return self.SellerOrganisationBankName
    def set_SellerOrganisationBankName(self, SellerOrganisationBankName): self.SellerOrganisationBankName = SellerOrganisationBankName
    def add_SellerOrganisationBankName(self, value): self.SellerOrganisationBankName.append(value)
    def insert_SellerOrganisationBankName_at(self, index, value): self.SellerOrganisationBankName.insert(index, value)
    def replace_SellerOrganisationBankName_at(self, index, value): self.SellerOrganisationBankName[index] = value
    def get_SellerPostalAddressDetails(self): return self.SellerPostalAddressDetails
    def set_SellerPostalAddressDetails(self, SellerPostalAddressDetails): self.SellerPostalAddressDetails = SellerPostalAddressDetails
    def validate_genericStringType1_48(self, value):
        # Validate type genericStringType1_48, a restriction on xs:string.
        pass
    def validate_genericStringType1_35(self, value):
        # Validate type genericStringType1_35, a restriction on xs:string.
        pass
    def hasContent_(self):
        if (
            self.SellerPartyIdentifier is not None or
            self.SellerOrganisationNames or
            self.SellerOrganisationBankName or
            self.SellerPostalAddressDetails is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerPartyDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerPartyDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerPartyDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerPartyDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='SellerPartyDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.SellerPartyIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerPartyIdentifier>%s</%sSellerPartyIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.SellerPartyIdentifier).encode(ExternalEncoding), input_name='SellerPartyIdentifier'), namespace_, eol_))
        for SellerOrganisationNames_ in self.SellerOrganisationNames:
            SellerOrganisationNames_.export(outfile, level, namespace_, name_='SellerOrganisationNames', pretty_print=pretty_print)
        for SellerOrganisationBankName_ in self.SellerOrganisationBankName:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerOrganisationBankName>%s</%sSellerOrganisationBankName>%s' % (namespace_, self.gds_format_string(quote_xml(SellerOrganisationBankName_).encode(ExternalEncoding), input_name='SellerOrganisationBankName'), namespace_, eol_))
        if self.SellerPostalAddressDetails is not None:
            self.SellerPostalAddressDetails.export(outfile, level, namespace_, name_='SellerPostalAddressDetails', pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='SellerPartyDetailsType'):
        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.SellerPartyIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('SellerPartyIdentifier=%s,\n' % quote_python(self.SellerPartyIdentifier).encode(ExternalEncoding))
        showIndent(outfile, level)
        outfile.write('SellerOrganisationNames=[\n')
        level += 1
        for SellerOrganisationNames_ in self.SellerOrganisationNames:
            showIndent(outfile, level)
            outfile.write('model_.SellerOrganisationNamesType(\n')
            SellerOrganisationNames_.exportLiteral(outfile, level, name_='SellerOrganisationNamesType')
            showIndent(outfile, level)
            outfile.write('),\n')
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        showIndent(outfile, level)
        outfile.write('SellerOrganisationBankName=[\n')
        level += 1
        for SellerOrganisationBankName_ in self.SellerOrganisationBankName:
            showIndent(outfile, level)
            outfile.write('%s,\n' % quote_python(SellerOrganisationBankName_).encode(ExternalEncoding))
        level -= 1
        showIndent(outfile, level)
        outfile.write('],\n')
        if self.SellerPostalAddressDetails is not None:
            showIndent(outfile, level)
            outfile.write('SellerPostalAddressDetails=model_.SellerPostalAddressDetailsType(\n')
            self.SellerPostalAddressDetails.exportLiteral(outfile, level, name_='SellerPostalAddressDetails')
            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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SellerPartyIdentifier':
            SellerPartyIdentifier_ = child_.text
            SellerPartyIdentifier_ = self.gds_validate_string(SellerPartyIdentifier_, node, 'SellerPartyIdentifier')
            self.SellerPartyIdentifier = SellerPartyIdentifier_
            self.validate_genericStringType1_48(self.SellerPartyIdentifier)    # validate type genericStringType1_48
        elif nodeName_ == 'SellerOrganisationNames':
            obj_ = SellerOrganisationNamesType.factory()
            obj_.build(child_)
            self.SellerOrganisationNames.append(obj_)
            obj_.original_tagname_ = 'SellerOrganisationNames'
        elif nodeName_ == 'SellerOrganisationBankName':
            SellerOrganisationBankName_ = child_.text
            SellerOrganisationBankName_ = self.gds_validate_string(SellerOrganisationBankName_, node, 'SellerOrganisationBankName')
            self.SellerOrganisationBankName.append(SellerOrganisationBankName_)
            self.validate_genericStringType1_35(self.SellerOrganisationBankName)    # validate type genericStringType1_35
        elif nodeName_ == 'SellerPostalAddressDetails':
            obj_ = SellerPostalAddressDetailsType.factory()
            obj_.build(child_)
            self.SellerPostalAddressDetails = obj_
            obj_.original_tagname_ = 'SellerPostalAddressDetails'
# end class SellerPartyDetailsType


class SellerOrganisationNamesType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, LanguageCode=None, SellerOrganisationName=None):
        self.original_tagname_ = None
        self.LanguageCode = _cast(None, LanguageCode)
        if SellerOrganisationName is None:
            self.SellerOrganisationName = []
        else:
            self.SellerOrganisationName = SellerOrganisationName
    def factory(*args_, **kwargs_):
        if SellerOrganisationNamesType.subclass:
            return SellerOrganisationNamesType.subclass(*args_, **kwargs_)
        else:
            return SellerOrganisationNamesType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SellerOrganisationName(self): return self.SellerOrganisationName
    def set_SellerOrganisationName(self, SellerOrganisationName): self.SellerOrganisationName = SellerOrganisationName
    def add_SellerOrganisationName(self, value): self.SellerOrganisationName.append(value)
    def insert_SellerOrganisationName_at(self, index, value): self.SellerOrganisationName.insert(index, value)
    def replace_SellerOrganisationName_at(self, index, value): self.SellerOrganisationName[index] = value
    def get_LanguageCode(self): return self.LanguageCode
    def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode
    def validate_genericStringType2_70(self, value):
        # Validate type genericStringType2_70, a restriction on xs:string.
        pass
    def validate_LanguageCodeType(self, value):
        # Validate type LanguageCodeType, a restriction on xs:NMTOKEN.
        pass
    def hasContent_(self):
        if (
            self.SellerOrganisationName
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerOrganisationNamesType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerOrganisationNamesType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerOrganisationNamesType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerOrganisationNamesType'):
        if self.LanguageCode is not None and 'LanguageCode' not in already_processed:
            already_processed.add('LanguageCode')
            outfile.write(' LanguageCode=%s' % (quote_attrib(self.LanguageCode), ))
    def exportChildren(self, outfile, level, namespace_='', name_='SellerOrganisationNamesType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        for SellerOrganisationName_ in self.SellerOrganisationName:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerOrganisationName>%s</%sSellerOrganisationName>%s' % (namespace_, self.gds_format_string(quote_xml(SellerOrganisationName_).encode(ExternalEncoding), input_name='SellerOrganisationName'), namespace_, eol_))
    def exportLiteral(self, outfile, level, name_='SellerOrganisationNamesType'):
        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.LanguageCode is not None and 'LanguageCode' not in already_processed:
            already_processed.add('LanguageCode')
            showIndent(outfile, level)
            outfile.write('LanguageCode="%s",\n' % (self.LanguageCode,))
    def exportLiteralChildren(self, outfile, level, name_):
        showIndent(outfile, level)
        outfile.write('SellerOrganisationName=[\n')
        level += 1
        for SellerOrganisationName_ in self.SellerOrganisationName:
            showIndent(outfile, level)
            outfile.write('%s,\n' % quote_python(SellerOrganisationName_).encode(ExternalEncoding))
        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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('LanguageCode', node)
        if value is not None and 'LanguageCode' not in already_processed:
            already_processed.add('LanguageCode')
            self.LanguageCode = value
            self.validate_LanguageCodeType(self.LanguageCode)    # validate type LanguageCodeType
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SellerOrganisationName':
            SellerOrganisationName_ = child_.text
            SellerOrganisationName_ = self.gds_validate_string(SellerOrganisationName_, node, 'SellerOrganisationName')
            self.SellerOrganisationName.append(SellerOrganisationName_)
            self.validate_genericStringType2_70(self.SellerOrganisationName)    # validate type genericStringType2_70
# end class SellerOrganisationNamesType


class SellerPostalAddressDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, SellerStreetName=None, SellerTownName=None, SellerPostCodeIdentifier=None, CountryCode=None, CountryName=None, SellerPostOfficeBoxIdentifier=None):
        self.original_tagname_ = None
        self.SellerStreetName = SellerStreetName
        self.SellerTownName = SellerTownName
        self.SellerPostCodeIdentifier = SellerPostCodeIdentifier
        self.CountryCode = CountryCode
        self.CountryName = CountryName
        self.SellerPostOfficeBoxIdentifier = SellerPostOfficeBoxIdentifier
    def factory(*args_, **kwargs_):
        if SellerPostalAddressDetailsType.subclass:
            return SellerPostalAddressDetailsType.subclass(*args_, **kwargs_)
        else:
            return SellerPostalAddressDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SellerStreetName(self): return self.SellerStreetName
    def set_SellerStreetName(self, SellerStreetName): self.SellerStreetName = SellerStreetName
    def get_SellerTownName(self): return self.SellerTownName
    def set_SellerTownName(self, SellerTownName): self.SellerTownName = SellerTownName
    def get_SellerPostCodeIdentifier(self): return self.SellerPostCodeIdentifier
    def set_SellerPostCodeIdentifier(self, SellerPostCodeIdentifier): self.SellerPostCodeIdentifier = SellerPostCodeIdentifier
    def get_CountryCode(self): return self.CountryCode
    def set_CountryCode(self, CountryCode): self.CountryCode = CountryCode
    def get_CountryName(self): return self.CountryName
    def set_CountryName(self, CountryName): self.CountryName = CountryName
    def get_SellerPostOfficeBoxIdentifier(self): return self.SellerPostOfficeBoxIdentifier
    def set_SellerPostOfficeBoxIdentifier(self, SellerPostOfficeBoxIdentifier): self.SellerPostOfficeBoxIdentifier = SellerPostOfficeBoxIdentifier
    def validate_genericStringType2_35(self, value):
        # Validate type genericStringType2_35, a restriction on xs:string.
        pass
    def validate_genericStringType1_48(self, value):
        # Validate type genericStringType1_48, a restriction on xs:string.
        pass
    def validate_CountryCodeType(self, value):
        # Validate type CountryCodeType, a restriction on xs:NMTOKEN.
        pass
    def hasContent_(self):
        if (
            self.SellerStreetName is not None or
            self.SellerTownName is not None or
            self.SellerPostCodeIdentifier is not None or
            self.CountryCode is not None or
            self.CountryName is not None or
            self.SellerPostOfficeBoxIdentifier is not None
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerPostalAddressDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerPostalAddressDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerPostalAddressDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerPostalAddressDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='SellerPostalAddressDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.SellerStreetName is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerStreetName>%s</%sSellerStreetName>%s' % (namespace_, self.gds_format_string(quote_xml(self.SellerStreetName).encode(ExternalEncoding), input_name='SellerStreetName'), namespace_, eol_))
        if self.SellerTownName is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerTownName>%s</%sSellerTownName>%s' % (namespace_, self.gds_format_string(quote_xml(self.SellerTownName).encode(ExternalEncoding), input_name='SellerTownName'), namespace_, eol_))
        if self.SellerPostCodeIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerPostCodeIdentifier>%s</%sSellerPostCodeIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.SellerPostCodeIdentifier).encode(ExternalEncoding), input_name='SellerPostCodeIdentifier'), namespace_, eol_))
        if self.CountryCode is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sCountryCode>%s</%sCountryCode>%s' % (namespace_, self.gds_format_string(quote_xml(self.CountryCode).encode(ExternalEncoding), input_name='CountryCode'), namespace_, eol_))
        if self.CountryName is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sCountryName>%s</%sCountryName>%s' % (namespace_, self.gds_format_string(quote_xml(self.CountryName).encode(ExternalEncoding), input_name='CountryName'), namespace_, eol_))
        if self.SellerPostOfficeBoxIdentifier is not None:
            showIndent(outfile, level, pretty_print)
            outfile.write('<%sSellerPostOfficeBoxIdentifier>%s</%sSellerPostOfficeBoxIdentifier>%s' % (namespace_, self.gds_format_string(quote_xml(self.SellerPostOfficeBoxIdentifier).encode(ExternalEncoding), input_name='SellerPostOfficeBoxIdentifier'), namespace_, eol_))
    def exportLiteral(self, outfile, level, name_='SellerPostalAddressDetailsType'):
        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.SellerStreetName is not None:
            showIndent(outfile, level)
            outfile.write('SellerStreetName=%s,\n' % quote_python(self.SellerStreetName).encode(ExternalEncoding))
        if self.SellerTownName is not None:
            showIndent(outfile, level)
            outfile.write('SellerTownName=%s,\n' % quote_python(self.SellerTownName).encode(ExternalEncoding))
        if self.SellerPostCodeIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('SellerPostCodeIdentifier=%s,\n' % quote_python(self.SellerPostCodeIdentifier).encode(ExternalEncoding))
        if self.CountryCode is not None:
            showIndent(outfile, level)
            outfile.write('CountryCode=%s,\n' % quote_python(self.CountryCode).encode(ExternalEncoding))
        if self.CountryName is not None:
            showIndent(outfile, level)
            outfile.write('CountryName=%s,\n' % quote_python(self.CountryName).encode(ExternalEncoding))
        if self.SellerPostOfficeBoxIdentifier is not None:
            showIndent(outfile, level)
            outfile.write('SellerPostOfficeBoxIdentifier=%s,\n' % quote_python(self.SellerPostOfficeBoxIdentifier).encode(ExternalEncoding))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SellerStreetName':
            SellerStreetName_ = child_.text
            SellerStreetName_ = self.gds_validate_string(SellerStreetName_, node, 'SellerStreetName')
            self.SellerStreetName = SellerStreetName_
            self.validate_genericStringType2_35(self.SellerStreetName)    # validate type genericStringType2_35
        elif nodeName_ == 'SellerTownName':
            SellerTownName_ = child_.text
            SellerTownName_ = self.gds_validate_string(SellerTownName_, node, 'SellerTownName')
            self.SellerTownName = SellerTownName_
            self.validate_genericStringType2_35(self.SellerTownName)    # validate type genericStringType2_35
        elif nodeName_ == 'SellerPostCodeIdentifier':
            SellerPostCodeIdentifier_ = child_.text
            SellerPostCodeIdentifier_ = self.gds_validate_string(SellerPostCodeIdentifier_, node, 'SellerPostCodeIdentifier')
            self.SellerPostCodeIdentifier = SellerPostCodeIdentifier_
            self.validate_genericStringType1_48(self.SellerPostCodeIdentifier)    # validate type genericStringType1_48
        elif nodeName_ == 'CountryCode':
            CountryCode_ = child_.text
            CountryCode_ = self.gds_validate_string(CountryCode_, node, 'CountryCode')
            self.CountryCode = CountryCode_
            self.validate_CountryCodeType(self.CountryCode)    # validate type CountryCodeType
        elif nodeName_ == 'CountryName':
            CountryName_ = child_.text
            CountryName_ = self.gds_validate_string(CountryName_, node, 'CountryName')
            self.CountryName = CountryName_
            self.validate_genericStringType2_35(self.CountryName)    # validate type genericStringType2_35
        elif nodeName_ == 'SellerPostOfficeBoxIdentifier':
            SellerPostOfficeBoxIdentifier_ = child_.text
            SellerPostOfficeBoxIdentifier_ = self.gds_validate_string(SellerPostOfficeBoxIdentifier_, node, 'SellerPostOfficeBoxIdentifier')
            self.SellerPostOfficeBoxIdentifier = SellerPostOfficeBoxIdentifier_
            self.validate_genericStringType1_48(self.SellerPostOfficeBoxIdentifier)    # validate type genericStringType1_48
# end class SellerPostalAddressDetailsType


class date(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, Format=None, valueOf_=None):
        self.original_tagname_ = None
        self.Format = _cast(None, Format)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if date.subclass:
            return date.subclass(*args_, **kwargs_)
        else:
            return date(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_Format(self): return self.Format
    def set_Format(self, Format): self.Format = Format
    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_='', name_='date', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='date')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='date', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='date'):
        if self.Format is not None and 'Format' not in already_processed:
            already_processed.add('Format')
            outfile.write(' Format=%s' % (self.gds_format_string(quote_attrib(self.Format).encode(ExternalEncoding), input_name='Format'), ))
    def exportChildren(self, outfile, level, namespace_='', name_='date', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='date'):
        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.Format is not None and 'Format' not in already_processed:
            already_processed.add('Format')
            showIndent(outfile, level)
            outfile.write('Format="%s",\n' % (self.Format,))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('Format', node)
        if value is not None and 'Format' not in already_processed:
            already_processed.add('Format')
            self.Format = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class date


class TextLanguageOptional(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, LanguageCode=None, valueOf_=None, extensiontype_=None):
        self.original_tagname_ = None
        self.LanguageCode = _cast(None, LanguageCode)
        self.valueOf_ = valueOf_
        self.extensiontype_ = extensiontype_
    def factory(*args_, **kwargs_):
        if TextLanguageOptional.subclass:
            return TextLanguageOptional.subclass(*args_, **kwargs_)
        else:
            return TextLanguageOptional(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_LanguageCode(self): return self.LanguageCode
    def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_extensiontype_(self): return self.extensiontype_
    def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
    def validate_LanguageCodeType(self, value):
        # Validate type LanguageCodeType, a restriction on xs:NMTOKEN.
        pass
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='TextLanguageOptional', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='TextLanguageOptional')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='TextLanguageOptional', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TextLanguageOptional'):
        if self.LanguageCode is not None and 'LanguageCode' not in already_processed:
            already_processed.add('LanguageCode')
            outfile.write(' LanguageCode=%s' % (quote_attrib(self.LanguageCode), ))
        if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
            outfile.write(' xsi:type="%s"' % self.extensiontype_)
    def exportChildren(self, outfile, level, namespace_='', name_='TextLanguageOptional', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='TextLanguageOptional'):
        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.LanguageCode is not None and 'LanguageCode' not in already_processed:
            already_processed.add('LanguageCode')
            showIndent(outfile, level)
            outfile.write('LanguageCode="%s",\n' % (self.LanguageCode,))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('LanguageCode', node)
        if value is not None and 'LanguageCode' not in already_processed:
            already_processed.add('LanguageCode')
            self.LanguageCode = value
            self.validate_LanguageCodeType(self.LanguageCode)    # validate type LanguageCodeType
        value = find_attr_value_('xsi:type', node)
        if value is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            self.extensiontype_ = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class TextLanguageOptional


class TextLanguageRequired(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, LanguageCode=None, valueOf_=None, extensiontype_=None):
        self.original_tagname_ = None
        self.LanguageCode = _cast(None, LanguageCode)
        self.valueOf_ = valueOf_
        self.extensiontype_ = extensiontype_
    def factory(*args_, **kwargs_):
        if TextLanguageRequired.subclass:
            return TextLanguageRequired.subclass(*args_, **kwargs_)
        else:
            return TextLanguageRequired(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_LanguageCode(self): return self.LanguageCode
    def set_LanguageCode(self, LanguageCode): self.LanguageCode = LanguageCode
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_extensiontype_(self): return self.extensiontype_
    def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
    def validate_LanguageCodeType(self, value):
        # Validate type LanguageCodeType, a restriction on xs:NMTOKEN.
        pass
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='TextLanguageRequired', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='TextLanguageRequired')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='TextLanguageRequired', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='TextLanguageRequired'):
        if self.LanguageCode is not None and 'LanguageCode' not in already_processed:
            already_processed.add('LanguageCode')
            outfile.write(' LanguageCode=%s' % (quote_attrib(self.LanguageCode), ))
        if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
            outfile.write(' xsi:type="%s"' % self.extensiontype_)
    def exportChildren(self, outfile, level, namespace_='', name_='TextLanguageRequired', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='TextLanguageRequired'):
        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.LanguageCode is not None and 'LanguageCode' not in already_processed:
            already_processed.add('LanguageCode')
            showIndent(outfile, level)
            outfile.write('LanguageCode="%s",\n' % (self.LanguageCode,))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('LanguageCode', node)
        if value is not None and 'LanguageCode' not in already_processed:
            already_processed.add('LanguageCode')
            self.LanguageCode = value
            self.validate_LanguageCodeType(self.LanguageCode)    # validate type LanguageCodeType
        value = find_attr_value_('xsi:type', node)
        if value is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            self.extensiontype_ = value
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class TextLanguageRequired


class SellerInvoiceIdentifierType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, SellerInvoiceIdentifierType=None, valueOf_=None):
        self.original_tagname_ = None
        self.SellerInvoiceIdentifierType = _cast(None, SellerInvoiceIdentifierType)
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if SellerInvoiceIdentifierType.subclass:
            return SellerInvoiceIdentifierType.subclass(*args_, **kwargs_)
        else:
            return SellerInvoiceIdentifierType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SellerInvoiceIdentifierType(self): return self.SellerInvoiceIdentifierType
    def set_SellerInvoiceIdentifierType(self, SellerInvoiceIdentifierType): self.SellerInvoiceIdentifierType = SellerInvoiceIdentifierType
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def validate_SellerInvoiceIdentifierTypeCode(self, value):
        # Validate type SellerInvoiceIdentifierTypeCode, a restriction on xs:NMTOKEN.
        pass
    def hasContent_(self):
        if (
            self.valueOf_
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerInvoiceIdentifierType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerInvoiceIdentifierType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerInvoiceIdentifierType', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerInvoiceIdentifierType'):
        if self.SellerInvoiceIdentifierType is not None and 'SellerInvoiceIdentifierType' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierType')
            outfile.write(' SellerInvoiceIdentifierType=%s' % (quote_attrib(self.SellerInvoiceIdentifierType), ))
    def exportChildren(self, outfile, level, namespace_='', name_='SellerInvoiceIdentifierType', fromsubclass_=False, pretty_print=True):
        pass
    def exportLiteral(self, outfile, level, name_='SellerInvoiceIdentifierType'):
        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.SellerInvoiceIdentifierType is not None and 'SellerInvoiceIdentifierType' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierType')
            showIndent(outfile, level)
            outfile.write('SellerInvoiceIdentifierType="%s",\n' % (self.SellerInvoiceIdentifierType,))
    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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('SellerInvoiceIdentifierType', node)
        if value is not None and 'SellerInvoiceIdentifierType' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierType')
            self.SellerInvoiceIdentifierType = value
            self.validate_SellerInvoiceIdentifierTypeCode(self.SellerInvoiceIdentifierType)    # validate type SellerInvoiceIdentifierTypeCode
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class SellerInvoiceIdentifierType


class SellerAccountIDType1(SellerAccountIDType):
    subclass = None
    superclass = SellerAccountIDType
    def __init__(self, IdentificationSchemeName=None, valueOf_=None):
        self.original_tagname_ = None
        super(SellerAccountIDType1, self).__init__(IdentificationSchemeName, valueOf_, )
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if SellerAccountIDType1.subclass:
            return SellerAccountIDType1.subclass(*args_, **kwargs_)
        else:
            return SellerAccountIDType1(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_ or
            super(SellerAccountIDType1, self).hasContent_()
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerAccountIDType1', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerAccountIDType1')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerAccountIDType1', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerAccountIDType1'):
        super(SellerAccountIDType1, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SellerAccountIDType1')
    def exportChildren(self, outfile, level, namespace_='', name_='SellerAccountIDType1', fromsubclass_=False, pretty_print=True):
        super(SellerAccountIDType1, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
        pass
    def exportLiteral(self, outfile, level, name_='SellerAccountIDType1'):
        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_):
        super(SellerAccountIDType1, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(SellerAccountIDType1, self).exportLiteralChildren(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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        super(SellerAccountIDType1, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class SellerAccountIDType1


class SellerBicType2(SellerBicType):
    subclass = None
    superclass = SellerBicType
    def __init__(self, IdentificationSchemeName=None, valueOf_=None):
        self.original_tagname_ = None
        super(SellerBicType2, self).__init__(IdentificationSchemeName, valueOf_, )
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if SellerBicType2.subclass:
            return SellerBicType2.subclass(*args_, **kwargs_)
        else:
            return SellerBicType2(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_ or
            super(SellerBicType2, self).hasContent_()
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerBicType2', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerBicType2')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerBicType2', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerBicType2'):
        super(SellerBicType2, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SellerBicType2')
    def exportChildren(self, outfile, level, namespace_='', name_='SellerBicType2', fromsubclass_=False, pretty_print=True):
        super(SellerBicType2, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
        pass
    def exportLiteral(self, outfile, level, name_='SellerBicType2'):
        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_):
        super(SellerBicType2, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(SellerBicType2, self).exportLiteralChildren(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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        super(SellerBicType2, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class SellerBicType2


class SellerInstructionFreeTextType(TextLanguageOptional):
    subclass = None
    superclass = TextLanguageOptional
    def __init__(self, LanguageCode=None, valueOf_=None):
        self.original_tagname_ = None
        super(SellerInstructionFreeTextType, self).__init__(LanguageCode, valueOf_, )
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if SellerInstructionFreeTextType.subclass:
            return SellerInstructionFreeTextType.subclass(*args_, **kwargs_)
        else:
            return SellerInstructionFreeTextType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_ or
            super(SellerInstructionFreeTextType, self).hasContent_()
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerInstructionFreeTextType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerInstructionFreeTextType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerInstructionFreeTextType', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerInstructionFreeTextType'):
        super(SellerInstructionFreeTextType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SellerInstructionFreeTextType')
    def exportChildren(self, outfile, level, namespace_='', name_='SellerInstructionFreeTextType', fromsubclass_=False, pretty_print=True):
        super(SellerInstructionFreeTextType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
        pass
    def exportLiteral(self, outfile, level, name_='SellerInstructionFreeTextType'):
        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_):
        super(SellerInstructionFreeTextType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(SellerInstructionFreeTextType, self).exportLiteralChildren(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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        super(SellerInstructionFreeTextType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class SellerInstructionFreeTextType


class SellerInvoiceTypeDetailsType(GeneratedsSuper):
    subclass = None
    superclass = None
    def __init__(self, SellerInvoiceTypeText=None, SellerInvoiceIdentifierText=None):
        self.original_tagname_ = None
        self.SellerInvoiceTypeText = SellerInvoiceTypeText
        if SellerInvoiceIdentifierText is None:
            self.SellerInvoiceIdentifierText = []
        else:
            self.SellerInvoiceIdentifierText = SellerInvoiceIdentifierText
    def factory(*args_, **kwargs_):
        if SellerInvoiceTypeDetailsType.subclass:
            return SellerInvoiceTypeDetailsType.subclass(*args_, **kwargs_)
        else:
            return SellerInvoiceTypeDetailsType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SellerInvoiceTypeText(self): return self.SellerInvoiceTypeText
    def set_SellerInvoiceTypeText(self, SellerInvoiceTypeText): self.SellerInvoiceTypeText = SellerInvoiceTypeText
    def get_SellerInvoiceIdentifierText(self): return self.SellerInvoiceIdentifierText
    def set_SellerInvoiceIdentifierText(self, SellerInvoiceIdentifierText): self.SellerInvoiceIdentifierText = SellerInvoiceIdentifierText
    def add_SellerInvoiceIdentifierText(self, value): self.SellerInvoiceIdentifierText.append(value)
    def insert_SellerInvoiceIdentifierText_at(self, index, value): self.SellerInvoiceIdentifierText.insert(index, value)
    def replace_SellerInvoiceIdentifierText_at(self, index, value): self.SellerInvoiceIdentifierText[index] = value
    def hasContent_(self):
        if (
            self.SellerInvoiceTypeText is not None or
            self.SellerInvoiceIdentifierText
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerInvoiceTypeDetailsType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerInvoiceTypeDetailsType')
        if self.hasContent_():
            outfile.write('>%s' % (eol_, ))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerInvoiceTypeDetailsType', pretty_print=pretty_print)
            showIndent(outfile, level, pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerInvoiceTypeDetailsType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='SellerInvoiceTypeDetailsType', fromsubclass_=False, pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.SellerInvoiceTypeText is not None:
            self.SellerInvoiceTypeText.export(outfile, level, namespace_, name_='SellerInvoiceTypeText', pretty_print=pretty_print)
        for SellerInvoiceIdentifierText_ in self.SellerInvoiceIdentifierText:
            SellerInvoiceIdentifierText_.export(outfile, level, namespace_, name_='SellerInvoiceIdentifierText', pretty_print=pretty_print)
    def exportLiteral(self, outfile, level, name_='SellerInvoiceTypeDetailsType'):
        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.SellerInvoiceTypeText is not None:
            showIndent(outfile, level)
            outfile.write('SellerInvoiceTypeText=model_.SellerInvoiceTypeTextType(\n')
            self.SellerInvoiceTypeText.exportLiteral(outfile, level, name_='SellerInvoiceTypeText')
            showIndent(outfile, level)
            outfile.write('),\n')
        showIndent(outfile, level)
        outfile.write('SellerInvoiceIdentifierText=[\n')
        level += 1
        for SellerInvoiceIdentifierText_ in self.SellerInvoiceIdentifierText:
            showIndent(outfile, level)
            outfile.write('model_.SellerInvoiceIdentifierTextType3(\n')
            SellerInvoiceIdentifierText_.exportLiteral(outfile, level, name_='SellerInvoiceIdentifierTextType3')
            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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'SellerInvoiceTypeText':
            obj_ = SellerInvoiceTypeTextType.factory()
            obj_.build(child_)
            self.SellerInvoiceTypeText = obj_
            obj_.original_tagname_ = 'SellerInvoiceTypeText'
        elif nodeName_ == 'SellerInvoiceIdentifierText':
            obj_ = SellerInvoiceIdentifierTextType3.factory()
            obj_.build(child_)
            self.SellerInvoiceIdentifierText.append(obj_)
            obj_.original_tagname_ = 'SellerInvoiceIdentifierText'
# end class SellerInvoiceTypeDetailsType


class SellerInvoiceTypeTextType(TextLanguageRequired):
    subclass = None
    superclass = TextLanguageRequired
    def __init__(self, LanguageCode=None, valueOf_=None):
        self.original_tagname_ = None
        super(SellerInvoiceTypeTextType, self).__init__(LanguageCode, valueOf_, )
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if SellerInvoiceTypeTextType.subclass:
            return SellerInvoiceTypeTextType.subclass(*args_, **kwargs_)
        else:
            return SellerInvoiceTypeTextType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_ or
            super(SellerInvoiceTypeTextType, self).hasContent_()
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerInvoiceTypeTextType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerInvoiceTypeTextType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerInvoiceTypeTextType', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerInvoiceTypeTextType'):
        super(SellerInvoiceTypeTextType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SellerInvoiceTypeTextType')
    def exportChildren(self, outfile, level, namespace_='', name_='SellerInvoiceTypeTextType', fromsubclass_=False, pretty_print=True):
        super(SellerInvoiceTypeTextType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
        pass
    def exportLiteral(self, outfile, level, name_='SellerInvoiceTypeTextType'):
        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_):
        super(SellerInvoiceTypeTextType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(SellerInvoiceTypeTextType, self).exportLiteralChildren(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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        super(SellerInvoiceTypeTextType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class SellerInvoiceTypeTextType


class SellerInvoiceIdentifierTextType(TextLanguageRequired):
    subclass = None
    superclass = TextLanguageRequired
    def __init__(self, LanguageCode=None, SellerInvoiceIdentifierType=None, SellerInvoiceIdentifierMinLength=1, SellerInvoiceIdentifierHyphens=False, SellerInvoiceIdentifierSpaces=False, SellerInvoiceIdentifierMaxLength=35, valueOf_=None, extensiontype_=None):
        self.original_tagname_ = None
        super(SellerInvoiceIdentifierTextType, self).__init__(LanguageCode, valueOf_, extensiontype_, )
        self.SellerInvoiceIdentifierType = _cast(None, SellerInvoiceIdentifierType)
        self.SellerInvoiceIdentifierMinLength = _cast(int, SellerInvoiceIdentifierMinLength)
        self.SellerInvoiceIdentifierHyphens = _cast(bool, SellerInvoiceIdentifierHyphens)
        self.SellerInvoiceIdentifierSpaces = _cast(bool, SellerInvoiceIdentifierSpaces)
        self.SellerInvoiceIdentifierMaxLength = _cast(int, SellerInvoiceIdentifierMaxLength)
        self.valueOf_ = valueOf_
        self.extensiontype_ = extensiontype_
    def factory(*args_, **kwargs_):
        if SellerInvoiceIdentifierTextType.subclass:
            return SellerInvoiceIdentifierTextType.subclass(*args_, **kwargs_)
        else:
            return SellerInvoiceIdentifierTextType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_SellerInvoiceIdentifierType(self): return self.SellerInvoiceIdentifierType
    def set_SellerInvoiceIdentifierType(self, SellerInvoiceIdentifierType): self.SellerInvoiceIdentifierType = SellerInvoiceIdentifierType
    def get_SellerInvoiceIdentifierMinLength(self): return self.SellerInvoiceIdentifierMinLength
    def set_SellerInvoiceIdentifierMinLength(self, SellerInvoiceIdentifierMinLength): self.SellerInvoiceIdentifierMinLength = SellerInvoiceIdentifierMinLength
    def get_SellerInvoiceIdentifierHyphens(self): return self.SellerInvoiceIdentifierHyphens
    def set_SellerInvoiceIdentifierHyphens(self, SellerInvoiceIdentifierHyphens): self.SellerInvoiceIdentifierHyphens = SellerInvoiceIdentifierHyphens
    def get_SellerInvoiceIdentifierSpaces(self): return self.SellerInvoiceIdentifierSpaces
    def set_SellerInvoiceIdentifierSpaces(self, SellerInvoiceIdentifierSpaces): self.SellerInvoiceIdentifierSpaces = SellerInvoiceIdentifierSpaces
    def get_SellerInvoiceIdentifierMaxLength(self): return self.SellerInvoiceIdentifierMaxLength
    def set_SellerInvoiceIdentifierMaxLength(self, SellerInvoiceIdentifierMaxLength): self.SellerInvoiceIdentifierMaxLength = SellerInvoiceIdentifierMaxLength
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def get_extensiontype_(self): return self.extensiontype_
    def set_extensiontype_(self, extensiontype_): self.extensiontype_ = extensiontype_
    def validate_SellerInvoiceIdentifierTypeCode(self, value):
        # Validate type SellerInvoiceIdentifierTypeCode, a restriction on xs:NMTOKEN.
        pass
    def hasContent_(self):
        if (
            self.valueOf_ or
            super(SellerInvoiceIdentifierTextType, self).hasContent_()
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerInvoiceIdentifierTextType', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerInvoiceIdentifierTextType')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerInvoiceIdentifierTextType', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerInvoiceIdentifierTextType'):
        super(SellerInvoiceIdentifierTextType, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SellerInvoiceIdentifierTextType')
        if self.SellerInvoiceIdentifierType is not None and 'SellerInvoiceIdentifierType' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierType')
            outfile.write(' SellerInvoiceIdentifierType=%s' % (quote_attrib(self.SellerInvoiceIdentifierType), ))
        if self.SellerInvoiceIdentifierMinLength is not None and 'SellerInvoiceIdentifierMinLength' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierMinLength')
            outfile.write(' SellerInvoiceIdentifierMinLength="%s"' % self.gds_format_integer(self.SellerInvoiceIdentifierMinLength, input_name='SellerInvoiceIdentifierMinLength'))
        if self.SellerInvoiceIdentifierHyphens is not None and 'SellerInvoiceIdentifierHyphens' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierHyphens')
            outfile.write(' SellerInvoiceIdentifierHyphens="%s"' % self.gds_format_boolean(self.SellerInvoiceIdentifierHyphens, input_name='SellerInvoiceIdentifierHyphens'))
        if self.SellerInvoiceIdentifierSpaces is not None and 'SellerInvoiceIdentifierSpaces' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierSpaces')
            outfile.write(' SellerInvoiceIdentifierSpaces="%s"' % self.gds_format_boolean(self.SellerInvoiceIdentifierSpaces, input_name='SellerInvoiceIdentifierSpaces'))
        if self.SellerInvoiceIdentifierMaxLength is not None and 'SellerInvoiceIdentifierMaxLength' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierMaxLength')
            outfile.write(' SellerInvoiceIdentifierMaxLength="%s"' % self.gds_format_integer(self.SellerInvoiceIdentifierMaxLength, input_name='SellerInvoiceIdentifierMaxLength'))
        if self.extensiontype_ is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            outfile.write(' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"')
            outfile.write(' xsi:type="%s"' % self.extensiontype_)
    def exportChildren(self, outfile, level, namespace_='', name_='SellerInvoiceIdentifierTextType', fromsubclass_=False, pretty_print=True):
        super(SellerInvoiceIdentifierTextType, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
        pass
    def exportLiteral(self, outfile, level, name_='SellerInvoiceIdentifierTextType'):
        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.SellerInvoiceIdentifierType is not None and 'SellerInvoiceIdentifierType' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierType')
            showIndent(outfile, level)
            outfile.write('SellerInvoiceIdentifierType="%s",\n' % (self.SellerInvoiceIdentifierType,))
        if self.SellerInvoiceIdentifierMinLength is not None and 'SellerInvoiceIdentifierMinLength' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierMinLength')
            showIndent(outfile, level)
            outfile.write('SellerInvoiceIdentifierMinLength=%d,\n' % (self.SellerInvoiceIdentifierMinLength,))
        if self.SellerInvoiceIdentifierHyphens is not None and 'SellerInvoiceIdentifierHyphens' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierHyphens')
            showIndent(outfile, level)
            outfile.write('SellerInvoiceIdentifierHyphens=%s,\n' % (self.SellerInvoiceIdentifierHyphens,))
        if self.SellerInvoiceIdentifierSpaces is not None and 'SellerInvoiceIdentifierSpaces' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierSpaces')
            showIndent(outfile, level)
            outfile.write('SellerInvoiceIdentifierSpaces=%s,\n' % (self.SellerInvoiceIdentifierSpaces,))
        if self.SellerInvoiceIdentifierMaxLength is not None and 'SellerInvoiceIdentifierMaxLength' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierMaxLength')
            showIndent(outfile, level)
            outfile.write('SellerInvoiceIdentifierMaxLength=%d,\n' % (self.SellerInvoiceIdentifierMaxLength,))
        super(SellerInvoiceIdentifierTextType, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(SellerInvoiceIdentifierTextType, self).exportLiteralChildren(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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        value = find_attr_value_('SellerInvoiceIdentifierType', node)
        if value is not None and 'SellerInvoiceIdentifierType' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierType')
            self.SellerInvoiceIdentifierType = value
            self.validate_SellerInvoiceIdentifierTypeCode(self.SellerInvoiceIdentifierType)    # validate type SellerInvoiceIdentifierTypeCode
        value = find_attr_value_('SellerInvoiceIdentifierMinLength', node)
        if value is not None and 'SellerInvoiceIdentifierMinLength' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierMinLength')
            try:
                self.SellerInvoiceIdentifierMinLength = int(value)
            except ValueError, exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('SellerInvoiceIdentifierHyphens', node)
        if value is not None and 'SellerInvoiceIdentifierHyphens' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierHyphens')
            if value in ('true', '1'):
                self.SellerInvoiceIdentifierHyphens = True
            elif value in ('false', '0'):
                self.SellerInvoiceIdentifierHyphens = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('SellerInvoiceIdentifierSpaces', node)
        if value is not None and 'SellerInvoiceIdentifierSpaces' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierSpaces')
            if value in ('true', '1'):
                self.SellerInvoiceIdentifierSpaces = True
            elif value in ('false', '0'):
                self.SellerInvoiceIdentifierSpaces = False
            else:
                raise_parse_error(node, 'Bad boolean attribute')
        value = find_attr_value_('SellerInvoiceIdentifierMaxLength', node)
        if value is not None and 'SellerInvoiceIdentifierMaxLength' not in already_processed:
            already_processed.add('SellerInvoiceIdentifierMaxLength')
            try:
                self.SellerInvoiceIdentifierMaxLength = int(value)
            except ValueError, exp:
                raise_parse_error(node, 'Bad integer attribute: %s' % exp)
        value = find_attr_value_('xsi:type', node)
        if value is not None and 'xsi:type' not in already_processed:
            already_processed.add('xsi:type')
            self.extensiontype_ = value
        super(SellerInvoiceIdentifierTextType, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class SellerInvoiceIdentifierTextType


class SellerInvoiceIdentifierTextType3(SellerInvoiceIdentifierTextType):
    subclass = None
    superclass = SellerInvoiceIdentifierTextType
    def __init__(self, LanguageCode=None, SellerInvoiceIdentifierType=None, SellerInvoiceIdentifierMinLength=1, SellerInvoiceIdentifierHyphens=False, SellerInvoiceIdentifierSpaces=False, SellerInvoiceIdentifierMaxLength=35, valueOf_=None):
        self.original_tagname_ = None
        super(SellerInvoiceIdentifierTextType3, self).__init__(LanguageCode, SellerInvoiceIdentifierType, SellerInvoiceIdentifierMinLength, SellerInvoiceIdentifierHyphens, SellerInvoiceIdentifierSpaces, SellerInvoiceIdentifierMaxLength, valueOf_, )
        self.valueOf_ = valueOf_
    def factory(*args_, **kwargs_):
        if SellerInvoiceIdentifierTextType3.subclass:
            return SellerInvoiceIdentifierTextType3.subclass(*args_, **kwargs_)
        else:
            return SellerInvoiceIdentifierTextType3(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_valueOf_(self): return self.valueOf_
    def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
    def hasContent_(self):
        if (
            self.valueOf_ or
            super(SellerInvoiceIdentifierTextType3, self).hasContent_()
        ):
            return True
        else:
            return False
    def export(self, outfile, level, namespace_='', name_='SellerInvoiceIdentifierTextType3', namespacedef_='', pretty_print=True):
        if pretty_print:
            eol_ = '\n'
        else:
            eol_ = ''
        if self.original_tagname_ is not None:
            name_ = self.original_tagname_
        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_='SellerInvoiceIdentifierTextType3')
        if self.hasContent_():
            outfile.write('>')
            outfile.write(str(self.valueOf_).encode(ExternalEncoding))
            self.exportChildren(outfile, level + 1, namespace_='', name_='SellerInvoiceIdentifierTextType3', pretty_print=pretty_print)
            outfile.write('</%s%s>%s' % (namespace_, name_, eol_))
        else:
            outfile.write('/>%s' % (eol_, ))
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='SellerInvoiceIdentifierTextType3'):
        super(SellerInvoiceIdentifierTextType3, self).exportAttributes(outfile, level, already_processed, namespace_, name_='SellerInvoiceIdentifierTextType3')
    def exportChildren(self, outfile, level, namespace_='', name_='SellerInvoiceIdentifierTextType3', fromsubclass_=False, pretty_print=True):
        super(SellerInvoiceIdentifierTextType3, self).exportChildren(outfile, level, namespace_, name_, True, pretty_print=pretty_print)
        pass
    def exportLiteral(self, outfile, level, name_='SellerInvoiceIdentifierTextType3'):
        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_):
        super(SellerInvoiceIdentifierTextType3, self).exportLiteralAttributes(outfile, level, already_processed, name_)
    def exportLiteralChildren(self, outfile, level, name_):
        super(SellerInvoiceIdentifierTextType3, self).exportLiteralChildren(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_)
        return self
    def buildAttributes(self, node, attrs, already_processed):
        super(SellerInvoiceIdentifierTextType3, self).buildAttributes(node, attrs, already_processed)
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        pass
# end class SellerInvoiceIdentifierTextType3


GDSClassesMapping = {
    'SellerPostalAddressDetails': SellerPostalAddressDetailsType,
    'SellerInstructionFreeText': SellerInstructionFreeTextType,
    'InvoiceRecipientDetails': InvoiceRecipientDetailsType,
    'SellerInvoiceDetails': SellerInvoiceDetailsType,
    'SellerInvoiceTypeText': SellerInvoiceTypeTextType,
    'BuyerPostalAddressDetails': BuyerPostalAddressDetailsType,
    'SellerAccountDetails': SellerAccountDetailsType,
    'SellerBic': SellerBicType2,
    'MessageDetails': MessageDetailsType,
    'SellerInvoiceIdentifier': SellerInvoiceIdentifierType,
    'SellerPartyDetails': SellerPartyDetailsType,
    'SellerInvoiceIdentifierText': SellerInvoiceIdentifierTextType3,
    'InvoiceSenderInformationDetails': InvoiceSenderInformationDetailsType,
    'SellerOrganisationNames': SellerOrganisationNamesType,
    'SellerInvoiceTypeDetails': SellerInvoiceTypeDetailsType,
    'BuyerPartyDetails': BuyerPartyDetailsType,
    'ConversionDetails': ConversionDetailsType,
    'MessageDate': date,
    'SellerAccountID': SellerAccountIDType1,
}


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, silence=False):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'FinvoiceReceiverInfo'
        rootClass = FinvoiceReceiverInfo
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    if not silence:
        sys.stdout.write('<?xml version="1.0" ?>\n')
        rootObj.export(
            sys.stdout, 0, name_=rootTag,
            namespacedef_='',
            pretty_print=True)
    return rootObj


def parseEtree(inFileName, silence=False):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'FinvoiceReceiverInfo'
        rootClass = FinvoiceReceiverInfo
    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)
    if not silence:
        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, silence=False):
    from StringIO import StringIO
    doc = parsexml_(StringIO(inString))
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'FinvoiceReceiverInfo'
        rootClass = FinvoiceReceiverInfo
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    if not silence:
        sys.stdout.write('<?xml version="1.0" ?>\n')
        rootObj.export(
            sys.stdout, 0, name_=rootTag,
            namespacedef_='')
    return rootObj


def parseLiteral(inFileName, silence=False):
    doc = parsexml_(inFileName)
    rootNode = doc.getroot()
    rootTag, rootClass = get_root_tag(rootNode)
    if rootClass is None:
        rootTag = 'FinvoiceReceiverInfo'
        rootClass = FinvoiceReceiverInfo
    rootObj = rootClass.factory()
    rootObj.build(rootNode)
    # Enable Python to collect the space used by the DOM.
    doc = None
    if not silence:
        sys.stdout.write('#from receiverinfo import *\n\n')
        sys.stdout.write('import receiverinfo as model_\n\n')
        sys.stdout.write('rootObj = model_.rootClass(\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__ = [
    "BuyerPartyDetailsType",
    "BuyerPostalAddressDetailsType",
    "ConversionDetailsType",
    "FinvoiceReceiverInfo",
    "InvoiceRecipientDetailsType",
    "InvoiceSenderInformationDetailsType",
    "MessageDetailsType",
    "SellerAccountDetailsType",
    "SellerAccountIDType",
    "SellerAccountIDType1",
    "SellerBicType",
    "SellerBicType2",
    "SellerInstructionFreeTextType",
    "SellerInvoiceDetailsType",
    "SellerInvoiceIdentifierTextType",
    "SellerInvoiceIdentifierTextType3",
    "SellerInvoiceIdentifierType",
    "SellerInvoiceTypeDetailsType",
    "SellerInvoiceTypeTextType",
    "SellerOrganisationNamesType",
    "SellerPartyDetailsType",
    "SellerPostalAddressDetailsType",
    "TextLanguageOptional",
    "TextLanguageRequired",
    "date"
]
