'Export this resource as S3XML
@param start: index of the first record to export (slicing)
@param limit: maximum number of records to export (slicing)
@param msince: export only records which have been modified
after this datetime
@param fields: data fields to include (default: all)
@param dereference: include referenced resources
@param maxdepth: maximum depth for reference exports
@param mcomponents: components of the master resource to
include (list of aliases), empty list
for all available components
@param rcomponents: components of referenced resources to
include (list of "tablename:alias")
@param references: foreign keys to include (default: all)
@param stylesheet: path to the XSLT stylesheet (if required)
@param as_tree: return the ElementTree (do not convert into string)
@param as_json: represent the XML tree as JSON
@param maxbounds: include lat/lon boundaries in the top
level element (off by default)
@param filters: additional URL filters (Sync), as dict
{tablename: {url_var: string}}
@param pretty_print: insert newlines/indentation in the output
@param location_data: dictionary of location data which has been
looked-up in bulk ready for xml.gis_encode()
@param map_data: dictionary of options which can be read by the map
@param target: alias of component targetted (or None to target master resource)
@param args: dict of arguments to pass to the XSLT stylesheet'

def export_xml(self, start=None, limit=None, msince=None, fields=None, dereference=True, maxdepth=MAXDEPTH, mcomponents=[], rcomponents=None, references=None, stylesheet=None, as_tree=False, as_json=False, maxbounds=False, filters=None, pretty_print=False, location_data=None, map_data=None, target=None, **args):

    xml = current.xml
    output = None
    args = Storage(args)
    xmlformat = (S3XMLFormat(stylesheet) if stylesheet else None)
    tree = self.export_tree(start=start, limit=limit, msince=msince, fields=fields, dereference=dereference, maxdepth=maxdepth, mcomponents=mcomponents, rcomponents=rcomponents, references=references, filters=filters, maxbounds=maxbounds, xmlformat=xmlformat, location_data=location_data, map_data=map_data, target=target)
    if (tree and (xmlformat is not None)):
        import uuid
        args.update(domain=xml.domain, base_url=current.response.s3.base_url, prefix=self.prefix, name=self.name, utcnow=s3_format_datetime(), msguid=uuid.uuid4().urn)
        tree = xmlformat.transform(tree, **args)
    if tree:
        if as_tree:
            output = tree
        elif as_json:
            output = xml.tree2json(tree, pretty_print=pretty_print)
        else:
            output = xml.tostring(tree, pretty_print=pretty_print)
    return output
