<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:f="http://www.flickr.com/services/api/"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:digest="http://nwalsh.com/xslt/ext/com.nwalsh.xslt.Digest"
                version="2"
                exclude-result-prefixes="digest f xs">
   <xsl:param name="f:api_key" select="()"/>
   <xsl:param name="f:shared_secret" select="()"/>
   <xsl:param name="f:auth_token" select="()"/>
   <xsl:param name="f:debug" select="false()"/>
   <xsl:template name="f:flickr" as="element()">
      <xsl:param name="method" as="xs:string" required="yes"/>
      <xsl:param name="uriparams" as="xs:string" required="yes"/>
      <xsl:if test="empty($f:api_key)">
         <xsl:message terminate="yes">
            <xsl:text>Error: you must specify an api_key for Flickr.</xsl:text>
         </xsl:message>
      </xsl:if>
      <xsl:variable name="uri">
         <xsl:text>http://www.flickr.com/services/rest/?method=</xsl:text>
         <xsl:value-of select="$method"/>
         <xsl:value-of select="$uriparams"/>
      </xsl:variable>
      <xsl:if test="$f:debug">
         <xsl:message>
            <xsl:text>FLICKR: </xsl:text>
            <xsl:value-of select="$uri"/>
         </xsl:message>
      </xsl:if>
      <xsl:sequence select="document($uri)/*"/>
   </xsl:template>
   <xsl:template name="f:flickr.auth" as="xs:string">
      <xsl:param name="sig"/>
      <xsl:if test="empty($f:auth_token)">
         <xsl:message terminate="yes">
            <xsl:text>Error: you must specify an api_key for Flickr.</xsl:text>
         </xsl:message>
      </xsl:if>
      <xsl:value-of select="digest:md5(concat($f:shared_secret,$sig))"/>
   </xsl:template>
   <xsl:template name="f:activity.userComments" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.activity.userComments</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.activity.userComments'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:activity.userPhotos" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="timeframe" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($timeframe)) then concat('&amp;timeframe=', $timeframe) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.activity.userPhotos</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($timeframe)) then concat('timeframe', $timeframe) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.activity.userPhotos'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:auth.checkToken" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="auth_token" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($auth_token)) then concat('&amp;auth_token=', $auth_token) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.auth.checkToken</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.auth.checkToken'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:auth.getFrob" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.auth.getFrob</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.auth.getFrob'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:auth.getFullToken" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="mini_token" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($mini_token)) then concat('&amp;mini_token=', $mini_token) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.auth.getFullToken</xsl:text>
                  <xsl:value-of select="if (exists($mini_token)) then concat('mini_token', $mini_token) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.auth.getFullToken'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:auth.getToken" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="frob" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($frob)) then concat('&amp;frob=', $frob) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($frob)) then concat('frob', $frob) else ''"/>
                  <xsl:text>methodflickr.auth.getToken</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.auth.getToken'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:blogs.getList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.blogs.getList</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.blogs.getList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:blogs.postPhoto" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="blog_id" as="xs:string?" required="yes"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="title" as="xs:string?" required="yes"/>
      <xsl:param name="description" as="xs:string?" required="yes"/>
      <xsl:param name="blog_password" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($blog_id)) then concat('&amp;blog_id=', $blog_id) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($title)) then concat('&amp;title=', $title) else ''"/>
         <xsl:value-of select="if (exists($description)) then concat('&amp;description=', $description) else ''"/>
         <xsl:value-of select="if (exists($blog_password)) then concat('&amp;blog_password=', $blog_password) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($blog_id)) then concat('blog_id', $blog_id) else ''"/>
                  <xsl:value-of select="if (exists($blog_password)) then concat('blog_password', $blog_password) else ''"/>
                  <xsl:value-of select="if (exists($description)) then concat('description', $description) else ''"/>
                  <xsl:text>methodflickr.blogs.postPhoto</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
                  <xsl:value-of select="if (exists($title)) then concat('title', $title) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.blogs.postPhoto'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:contacts.getList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="filter" as="xs:string?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($filter)) then concat('&amp;filter=', $filter) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($filter)) then concat('filter', $filter) else ''"/>
                  <xsl:text>methodflickr.contacts.getList</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.contacts.getList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:contacts.getPublicList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" required="yes"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.contacts.getPublicList</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.contacts.getPublicList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:favorites.add" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.favorites.add</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.favorites.add'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:favorites.getList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:text>methodflickr.favorites.getList</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.favorites.getList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:favorites.getPublicList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" required="yes"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:text>methodflickr.favorites.getPublicList</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.favorites.getPublicList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:favorites.remove" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.favorites.remove</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.favorites.remove'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:groups.browse" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="cat_id" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($cat_id)) then concat('&amp;cat_id=', $cat_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($cat_id)) then concat('cat_id', $cat_id) else ''"/>
                  <xsl:text>methodflickr.groups.browse</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.groups.browse'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:groups.getInfo" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="group_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($group_id)) then concat('&amp;group_id=', $group_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($group_id)) then concat('group_id', $group_id) else ''"/>
                  <xsl:text>methodflickr.groups.getInfo</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.groups.getInfo'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:groups.search" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="text" as="xs:string?" required="yes"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($text)) then concat('&amp;text=', $text) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.groups.search</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($text)) then concat('text', $text) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.groups.search'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:groups.pools.add" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="group_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($group_id)) then concat('&amp;group_id=', $group_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($group_id)) then concat('group_id', $group_id) else ''"/>
                  <xsl:text>methodflickr.groups.pools.add</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.groups.pools.add'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:groups.pools.getContext" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="group_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($group_id)) then concat('&amp;group_id=', $group_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($group_id)) then concat('group_id', $group_id) else ''"/>
                  <xsl:text>methodflickr.groups.pools.getContext</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.groups.pools.getContext'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:groups.pools.getGroups" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.groups.pools.getGroups</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.groups.pools.getGroups'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:groups.pools.getPhotos" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="group_id" as="xs:string?" required="yes"/>
      <xsl:param name="tags" as="xs:string?" select="()"/>
      <xsl:param name="user_id" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($group_id)) then concat('&amp;group_id=', $group_id) else ''"/>
         <xsl:value-of select="if (exists($tags)) then concat('&amp;tags=', $tags) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:value-of select="if (exists($group_id)) then concat('group_id', $group_id) else ''"/>
                  <xsl:text>methodflickr.groups.pools.getPhotos</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($tags)) then concat('tags', $tags) else ''"/>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.groups.pools.getPhotos'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:groups.pools.remove" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="group_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($group_id)) then concat('&amp;group_id=', $group_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($group_id)) then concat('group_id', $group_id) else ''"/>
                  <xsl:text>methodflickr.groups.pools.remove</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.groups.pools.remove'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:interestingness.getList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="date" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($date)) then concat('&amp;date=', $date) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($date)) then concat('date', $date) else ''"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:text>methodflickr.interestingness.getList</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.interestingness.getList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:people.findByEmail" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="find_email" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($find_email)) then concat('&amp;find_email=', $find_email) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($find_email)) then concat('find_email', $find_email) else ''"/>
                  <xsl:text>methodflickr.people.findByEmail</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.people.findByEmail'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:people.findByUsername" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="username" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($username)) then concat('&amp;username=', $username) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.people.findByUsername</xsl:text>
                  <xsl:value-of select="if (exists($username)) then concat('username', $username) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.people.findByUsername'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:people.getInfo" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.people.getInfo</xsl:text>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.people.getInfo'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:people.getPublicGroups" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.people.getPublicGroups</xsl:text>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.people.getPublicGroups'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:people.getPublicPhotos" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" required="yes"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:text>methodflickr.people.getPublicPhotos</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.people.getPublicPhotos'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:people.getUploadStatus" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.people.getUploadStatus</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.people.getUploadStatus'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.addTags" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="tags" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($tags)) then concat('&amp;tags=', $tags) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.addTags</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
                  <xsl:value-of select="if (exists($tags)) then concat('tags', $tags) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.addTags'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.delete" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.delete</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.delete'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getAllContexts" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.getAllContexts</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getAllContexts'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getContactsPhotos" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="count" as="xs:integer?" select="()"/>
      <xsl:param name="just_friends" as="xs:string?" select="()"/>
      <xsl:param name="single_photo" as="xs:string?" select="()"/>
      <xsl:param name="include_self" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($count)) then concat('&amp;count=', $count) else ''"/>
         <xsl:value-of select="if (exists($just_friends)) then concat('&amp;just_friends=', $just_friends) else ''"/>
         <xsl:value-of select="if (exists($single_photo)) then concat('&amp;single_photo=', $single_photo) else ''"/>
         <xsl:value-of select="if (exists($include_self)) then concat('&amp;include_self=', $include_self) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($count)) then concat('count', $count) else ''"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:value-of select="if (exists($include_self)) then concat('include_self', $include_self) else ''"/>
                  <xsl:value-of select="if (exists($just_friends)) then concat('just_friends', $just_friends) else ''"/>
                  <xsl:text>methodflickr.photos.getContactsPhotos</xsl:text>
                  <xsl:value-of select="if (exists($single_photo)) then concat('single_photo', $single_photo) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getContactsPhotos'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getContactsPublicPhotos" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" required="yes"/>
      <xsl:param name="count" as="xs:integer?" select="()"/>
      <xsl:param name="just_friends" as="xs:string?" select="()"/>
      <xsl:param name="single_photo" as="xs:string?" select="()"/>
      <xsl:param name="include_self" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:value-of select="if (exists($count)) then concat('&amp;count=', $count) else ''"/>
         <xsl:value-of select="if (exists($just_friends)) then concat('&amp;just_friends=', $just_friends) else ''"/>
         <xsl:value-of select="if (exists($single_photo)) then concat('&amp;single_photo=', $single_photo) else ''"/>
         <xsl:value-of select="if (exists($include_self)) then concat('&amp;include_self=', $include_self) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($count)) then concat('count', $count) else ''"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:value-of select="if (exists($include_self)) then concat('include_self', $include_self) else ''"/>
                  <xsl:value-of select="if (exists($just_friends)) then concat('just_friends', $just_friends) else ''"/>
                  <xsl:text>methodflickr.photos.getContactsPublicPhotos</xsl:text>
                  <xsl:value-of select="if (exists($single_photo)) then concat('single_photo', $single_photo) else ''"/>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getContactsPublicPhotos'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getContext" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.getContext</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getContext'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getCounts" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="dates" as="xs:string?" select="()"/>
      <xsl:param name="taken_dates" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($dates)) then concat('&amp;dates=', $dates) else ''"/>
         <xsl:value-of select="if (exists($taken_dates)) then concat('&amp;taken_dates=', $taken_dates) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($dates)) then concat('dates', $dates) else ''"/>
                  <xsl:text>methodflickr.photos.getCounts</xsl:text>
                  <xsl:value-of select="if (exists($taken_dates)) then concat('taken_dates', $taken_dates) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getCounts'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getExif" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="secret" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($secret)) then concat('&amp;secret=', $secret) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.getExif</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
                  <xsl:value-of select="if (exists($secret)) then concat('secret', $secret) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getExif'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getInfo" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="secret" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($secret)) then concat('&amp;secret=', $secret) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.getInfo</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
                  <xsl:value-of select="if (exists($secret)) then concat('secret', $secret) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getInfo'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getNotInSet" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="min_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="max_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="min_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="max_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="privacy_filter" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($min_upload_date)) then concat('&amp;min_upload_date=', $min_upload_date) else ''"/>
         <xsl:value-of select="if (exists($max_upload_date)) then concat('&amp;max_upload_date=', $max_upload_date) else ''"/>
         <xsl:value-of select="if (exists($min_taken_date)) then concat('&amp;min_taken_date=', $min_taken_date) else ''"/>
         <xsl:value-of select="if (exists($max_taken_date)) then concat('&amp;max_taken_date=', $max_taken_date) else ''"/>
         <xsl:value-of select="if (exists($privacy_filter)) then concat('&amp;privacy_filter=', $privacy_filter) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:value-of select="if (exists($max_taken_date)) then concat('max_taken_date', $max_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($max_upload_date)) then concat('max_upload_date', $max_upload_date) else ''"/>
                  <xsl:text>methodflickr.photos.getNotInSet</xsl:text>
                  <xsl:value-of select="if (exists($min_taken_date)) then concat('min_taken_date', $min_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($min_upload_date)) then concat('min_upload_date', $min_upload_date) else ''"/>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($privacy_filter)) then concat('privacy_filter', $privacy_filter) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getNotInSet'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getPerms" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.getPerms</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getPerms'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getRecent" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:text>methodflickr.photos.getRecent</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getRecent'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getSizes" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.getSizes</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getSizes'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getUntagged" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="min_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="max_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="min_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="max_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="privacy_filter" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($min_upload_date)) then concat('&amp;min_upload_date=', $min_upload_date) else ''"/>
         <xsl:value-of select="if (exists($max_upload_date)) then concat('&amp;max_upload_date=', $max_upload_date) else ''"/>
         <xsl:value-of select="if (exists($min_taken_date)) then concat('&amp;min_taken_date=', $min_taken_date) else ''"/>
         <xsl:value-of select="if (exists($max_taken_date)) then concat('&amp;max_taken_date=', $max_taken_date) else ''"/>
         <xsl:value-of select="if (exists($privacy_filter)) then concat('&amp;privacy_filter=', $privacy_filter) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:value-of select="if (exists($max_taken_date)) then concat('max_taken_date', $max_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($max_upload_date)) then concat('max_upload_date', $max_upload_date) else ''"/>
                  <xsl:text>methodflickr.photos.getUntagged</xsl:text>
                  <xsl:value-of select="if (exists($min_taken_date)) then concat('min_taken_date', $min_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($min_upload_date)) then concat('min_upload_date', $min_upload_date) else ''"/>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($privacy_filter)) then concat('privacy_filter', $privacy_filter) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getUntagged'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getWithGeoData" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="min_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="max_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="min_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="max_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="privacy_filter" as="xs:string?" select="()"/>
      <xsl:param name="sort" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($min_upload_date)) then concat('&amp;min_upload_date=', $min_upload_date) else ''"/>
         <xsl:value-of select="if (exists($max_upload_date)) then concat('&amp;max_upload_date=', $max_upload_date) else ''"/>
         <xsl:value-of select="if (exists($min_taken_date)) then concat('&amp;min_taken_date=', $min_taken_date) else ''"/>
         <xsl:value-of select="if (exists($max_taken_date)) then concat('&amp;max_taken_date=', $max_taken_date) else ''"/>
         <xsl:value-of select="if (exists($privacy_filter)) then concat('&amp;privacy_filter=', $privacy_filter) else ''"/>
         <xsl:value-of select="if (exists($sort)) then concat('&amp;sort=', $sort) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:value-of select="if (exists($max_taken_date)) then concat('max_taken_date', $max_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($max_upload_date)) then concat('max_upload_date', $max_upload_date) else ''"/>
                  <xsl:text>methodflickr.photos.getWithGeoData</xsl:text>
                  <xsl:value-of select="if (exists($min_taken_date)) then concat('min_taken_date', $min_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($min_upload_date)) then concat('min_upload_date', $min_upload_date) else ''"/>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($privacy_filter)) then concat('privacy_filter', $privacy_filter) else ''"/>
                  <xsl:value-of select="if (exists($sort)) then concat('sort', $sort) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getWithGeoData'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.getWithoutGeoData" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="min_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="max_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="min_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="max_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="privacy_filter" as="xs:string?" select="()"/>
      <xsl:param name="sort" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($min_upload_date)) then concat('&amp;min_upload_date=', $min_upload_date) else ''"/>
         <xsl:value-of select="if (exists($max_upload_date)) then concat('&amp;max_upload_date=', $max_upload_date) else ''"/>
         <xsl:value-of select="if (exists($min_taken_date)) then concat('&amp;min_taken_date=', $min_taken_date) else ''"/>
         <xsl:value-of select="if (exists($max_taken_date)) then concat('&amp;max_taken_date=', $max_taken_date) else ''"/>
         <xsl:value-of select="if (exists($privacy_filter)) then concat('&amp;privacy_filter=', $privacy_filter) else ''"/>
         <xsl:value-of select="if (exists($sort)) then concat('&amp;sort=', $sort) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:value-of select="if (exists($max_taken_date)) then concat('max_taken_date', $max_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($max_upload_date)) then concat('max_upload_date', $max_upload_date) else ''"/>
                  <xsl:text>methodflickr.photos.getWithoutGeoData</xsl:text>
                  <xsl:value-of select="if (exists($min_taken_date)) then concat('min_taken_date', $min_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($min_upload_date)) then concat('min_upload_date', $min_upload_date) else ''"/>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($privacy_filter)) then concat('privacy_filter', $privacy_filter) else ''"/>
                  <xsl:value-of select="if (exists($sort)) then concat('sort', $sort) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.getWithoutGeoData'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.recentlyUpdated" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="min_date" as="xs:string?" required="yes"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($min_date)) then concat('&amp;min_date=', $min_date) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:text>methodflickr.photos.recentlyUpdated</xsl:text>
                  <xsl:value-of select="if (exists($min_date)) then concat('min_date', $min_date) else ''"/>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.recentlyUpdated'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.removeTag" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="tag_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($tag_id)) then concat('&amp;tag_id=', $tag_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.removeTag</xsl:text>
                  <xsl:value-of select="if (exists($tag_id)) then concat('tag_id', $tag_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.removeTag'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.search" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" select="()"/>
      <xsl:param name="tags" as="xs:string?" select="()"/>
      <xsl:param name="tag_mode" as="xs:string?" select="()"/>
      <xsl:param name="text" as="xs:string?" select="()"/>
      <xsl:param name="min_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="max_upload_date" as="xs:string?" select="()"/>
      <xsl:param name="min_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="max_taken_date" as="xs:string?" select="()"/>
      <xsl:param name="license" as="xs:string?" select="()"/>
      <xsl:param name="sort" as="xs:string?" select="()"/>
      <xsl:param name="privacy_filter" as="xs:string?" select="()"/>
      <xsl:param name="bbox" as="xs:string?" select="()"/>
      <xsl:param name="accuracy" as="xs:string?" select="()"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:value-of select="if (exists($tags)) then concat('&amp;tags=', $tags) else ''"/>
         <xsl:value-of select="if (exists($tag_mode)) then concat('&amp;tag_mode=', $tag_mode) else ''"/>
         <xsl:value-of select="if (exists($text)) then concat('&amp;text=', $text) else ''"/>
         <xsl:value-of select="if (exists($min_upload_date)) then concat('&amp;min_upload_date=', $min_upload_date) else ''"/>
         <xsl:value-of select="if (exists($max_upload_date)) then concat('&amp;max_upload_date=', $max_upload_date) else ''"/>
         <xsl:value-of select="if (exists($min_taken_date)) then concat('&amp;min_taken_date=', $min_taken_date) else ''"/>
         <xsl:value-of select="if (exists($max_taken_date)) then concat('&amp;max_taken_date=', $max_taken_date) else ''"/>
         <xsl:value-of select="if (exists($license)) then concat('&amp;license=', $license) else ''"/>
         <xsl:value-of select="if (exists($sort)) then concat('&amp;sort=', $sort) else ''"/>
         <xsl:value-of select="if (exists($privacy_filter)) then concat('&amp;privacy_filter=', $privacy_filter) else ''"/>
         <xsl:value-of select="if (exists($bbox)) then concat('&amp;bbox=', $bbox) else ''"/>
         <xsl:value-of select="if (exists($accuracy)) then concat('&amp;accuracy=', $accuracy) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($accuracy)) then concat('accuracy', $accuracy) else ''"/>
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($bbox)) then concat('bbox', $bbox) else ''"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:value-of select="if (exists($license)) then concat('license', $license) else ''"/>
                  <xsl:value-of select="if (exists($max_taken_date)) then concat('max_taken_date', $max_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($max_upload_date)) then concat('max_upload_date', $max_upload_date) else ''"/>
                  <xsl:text>methodflickr.photos.search</xsl:text>
                  <xsl:value-of select="if (exists($min_taken_date)) then concat('min_taken_date', $min_taken_date) else ''"/>
                  <xsl:value-of select="if (exists($min_upload_date)) then concat('min_upload_date', $min_upload_date) else ''"/>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($privacy_filter)) then concat('privacy_filter', $privacy_filter) else ''"/>
                  <xsl:value-of select="if (exists($sort)) then concat('sort', $sort) else ''"/>
                  <xsl:value-of select="if (exists($tag_mode)) then concat('tag_mode', $tag_mode) else ''"/>
                  <xsl:value-of select="if (exists($tags)) then concat('tags', $tags) else ''"/>
                  <xsl:value-of select="if (exists($text)) then concat('text', $text) else ''"/>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.search'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.setDates" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="date_posted" as="xs:string?" select="()"/>
      <xsl:param name="date_taken" as="xs:string?" select="()"/>
      <xsl:param name="date_taken_granularity" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($date_posted)) then concat('&amp;date_posted=', $date_posted) else ''"/>
         <xsl:value-of select="if (exists($date_taken)) then concat('&amp;date_taken=', $date_taken) else ''"/>
         <xsl:value-of select="if (exists($date_taken_granularity)) then concat('&amp;date_taken_granularity=', $date_taken_granularity) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($date_posted)) then concat('date_posted', $date_posted) else ''"/>
                  <xsl:value-of select="if (exists($date_taken)) then concat('date_taken', $date_taken) else ''"/>
                  <xsl:value-of select="if (exists($date_taken_granularity)) then concat('date_taken_granularity', $date_taken_granularity) else ''"/>
                  <xsl:text>methodflickr.photos.setDates</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.setDates'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.setMeta" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="title" as="xs:string?" required="yes"/>
      <xsl:param name="description" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($title)) then concat('&amp;title=', $title) else ''"/>
         <xsl:value-of select="if (exists($description)) then concat('&amp;description=', $description) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($description)) then concat('description', $description) else ''"/>
                  <xsl:text>methodflickr.photos.setMeta</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
                  <xsl:value-of select="if (exists($title)) then concat('title', $title) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.setMeta'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.setPerms" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="is_public" as="xs:string?" required="yes"/>
      <xsl:param name="is_friend" as="xs:string?" required="yes"/>
      <xsl:param name="is_family" as="xs:string?" required="yes"/>
      <xsl:param name="perm_comment" as="xs:string?" required="yes"/>
      <xsl:param name="perm_addmeta" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($is_public)) then concat('&amp;is_public=', $is_public) else ''"/>
         <xsl:value-of select="if (exists($is_friend)) then concat('&amp;is_friend=', $is_friend) else ''"/>
         <xsl:value-of select="if (exists($is_family)) then concat('&amp;is_family=', $is_family) else ''"/>
         <xsl:value-of select="if (exists($perm_comment)) then concat('&amp;perm_comment=', $perm_comment) else ''"/>
         <xsl:value-of select="if (exists($perm_addmeta)) then concat('&amp;perm_addmeta=', $perm_addmeta) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($is_family)) then concat('is_family', $is_family) else ''"/>
                  <xsl:value-of select="if (exists($is_friend)) then concat('is_friend', $is_friend) else ''"/>
                  <xsl:value-of select="if (exists($is_public)) then concat('is_public', $is_public) else ''"/>
                  <xsl:text>methodflickr.photos.setPerms</xsl:text>
                  <xsl:value-of select="if (exists($perm_addmeta)) then concat('perm_addmeta', $perm_addmeta) else ''"/>
                  <xsl:value-of select="if (exists($perm_comment)) then concat('perm_comment', $perm_comment) else ''"/>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.setPerms'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.setTags" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="tags" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($tags)) then concat('&amp;tags=', $tags) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.setTags</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
                  <xsl:value-of select="if (exists($tags)) then concat('tags', $tags) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.setTags'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.comments.addComment" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="comment_text" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($comment_text)) then concat('&amp;comment_text=', $comment_text) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($comment_text)) then concat('comment_text', $comment_text) else ''"/>
                  <xsl:text>methodflickr.photos.comments.addComment</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.comments.addComment'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.comments.deleteComment" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="comment_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($comment_id)) then concat('&amp;comment_id=', $comment_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($comment_id)) then concat('comment_id', $comment_id) else ''"/>
                  <xsl:text>methodflickr.photos.comments.deleteComment</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.comments.deleteComment'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.comments.editComment" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="comment_id" as="xs:string?" required="yes"/>
      <xsl:param name="comment_text" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($comment_id)) then concat('&amp;comment_id=', $comment_id) else ''"/>
         <xsl:value-of select="if (exists($comment_text)) then concat('&amp;comment_text=', $comment_text) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($comment_id)) then concat('comment_id', $comment_id) else ''"/>
                  <xsl:value-of select="if (exists($comment_text)) then concat('comment_text', $comment_text) else ''"/>
                  <xsl:text>methodflickr.photos.comments.editComment</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.comments.editComment'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.comments.getList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.comments.getList</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.comments.getList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.geo.getLocation" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.geo.getLocation</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.geo.getLocation'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.geo.getPerms" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.geo.getPerms</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.geo.getPerms'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.geo.removeLocation" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.geo.removeLocation</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.geo.removeLocation'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.geo.setLocation" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="lat" as="xs:string?" required="yes"/>
      <xsl:param name="lon" as="xs:string?" required="yes"/>
      <xsl:param name="accuracy" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($lat)) then concat('&amp;lat=', $lat) else ''"/>
         <xsl:value-of select="if (exists($lon)) then concat('&amp;lon=', $lon) else ''"/>
         <xsl:value-of select="if (exists($accuracy)) then concat('&amp;accuracy=', $accuracy) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($accuracy)) then concat('accuracy', $accuracy) else ''"/>
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($lat)) then concat('lat', $lat) else ''"/>
                  <xsl:value-of select="if (exists($lon)) then concat('lon', $lon) else ''"/>
                  <xsl:text>methodflickr.photos.geo.setLocation</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.geo.setLocation'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.geo.setPerms" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="is_public" as="xs:string?" required="yes"/>
      <xsl:param name="is_contact" as="xs:string?" required="yes"/>
      <xsl:param name="is_friend" as="xs:string?" required="yes"/>
      <xsl:param name="is_family" as="xs:string?" required="yes"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($is_public)) then concat('&amp;is_public=', $is_public) else ''"/>
         <xsl:value-of select="if (exists($is_contact)) then concat('&amp;is_contact=', $is_contact) else ''"/>
         <xsl:value-of select="if (exists($is_friend)) then concat('&amp;is_friend=', $is_friend) else ''"/>
         <xsl:value-of select="if (exists($is_family)) then concat('&amp;is_family=', $is_family) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($is_contact)) then concat('is_contact', $is_contact) else ''"/>
                  <xsl:value-of select="if (exists($is_family)) then concat('is_family', $is_family) else ''"/>
                  <xsl:value-of select="if (exists($is_friend)) then concat('is_friend', $is_friend) else ''"/>
                  <xsl:value-of select="if (exists($is_public)) then concat('is_public', $is_public) else ''"/>
                  <xsl:text>methodflickr.photos.geo.setPerms</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.geo.setPerms'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.licenses.getInfo" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.licenses.getInfo</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.licenses.getInfo'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.licenses.setLicense" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="license_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($license_id)) then concat('&amp;license_id=', $license_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($license_id)) then concat('license_id', $license_id) else ''"/>
                  <xsl:text>methodflickr.photos.licenses.setLicense</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.licenses.setLicense'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.notes.add" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="note_x" as="xs:string?" required="yes"/>
      <xsl:param name="note_y" as="xs:string?" required="yes"/>
      <xsl:param name="note_w" as="xs:string?" required="yes"/>
      <xsl:param name="note_h" as="xs:string?" required="yes"/>
      <xsl:param name="note_text" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($note_x)) then concat('&amp;note_x=', $note_x) else ''"/>
         <xsl:value-of select="if (exists($note_y)) then concat('&amp;note_y=', $note_y) else ''"/>
         <xsl:value-of select="if (exists($note_w)) then concat('&amp;note_w=', $note_w) else ''"/>
         <xsl:value-of select="if (exists($note_h)) then concat('&amp;note_h=', $note_h) else ''"/>
         <xsl:value-of select="if (exists($note_text)) then concat('&amp;note_text=', $note_text) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.notes.add</xsl:text>
                  <xsl:value-of select="if (exists($note_h)) then concat('note_h', $note_h) else ''"/>
                  <xsl:value-of select="if (exists($note_text)) then concat('note_text', $note_text) else ''"/>
                  <xsl:value-of select="if (exists($note_w)) then concat('note_w', $note_w) else ''"/>
                  <xsl:value-of select="if (exists($note_x)) then concat('note_x', $note_x) else ''"/>
                  <xsl:value-of select="if (exists($note_y)) then concat('note_y', $note_y) else ''"/>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.notes.add'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.notes.delete" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="note_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($note_id)) then concat('&amp;note_id=', $note_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.notes.delete</xsl:text>
                  <xsl:value-of select="if (exists($note_id)) then concat('note_id', $note_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.notes.delete'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.notes.edit" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="note_id" as="xs:string?" required="yes"/>
      <xsl:param name="note_x" as="xs:string?" required="yes"/>
      <xsl:param name="note_y" as="xs:string?" required="yes"/>
      <xsl:param name="note_w" as="xs:string?" required="yes"/>
      <xsl:param name="note_h" as="xs:string?" required="yes"/>
      <xsl:param name="note_text" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($note_id)) then concat('&amp;note_id=', $note_id) else ''"/>
         <xsl:value-of select="if (exists($note_x)) then concat('&amp;note_x=', $note_x) else ''"/>
         <xsl:value-of select="if (exists($note_y)) then concat('&amp;note_y=', $note_y) else ''"/>
         <xsl:value-of select="if (exists($note_w)) then concat('&amp;note_w=', $note_w) else ''"/>
         <xsl:value-of select="if (exists($note_h)) then concat('&amp;note_h=', $note_h) else ''"/>
         <xsl:value-of select="if (exists($note_text)) then concat('&amp;note_text=', $note_text) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.notes.edit</xsl:text>
                  <xsl:value-of select="if (exists($note_h)) then concat('note_h', $note_h) else ''"/>
                  <xsl:value-of select="if (exists($note_id)) then concat('note_id', $note_id) else ''"/>
                  <xsl:value-of select="if (exists($note_text)) then concat('note_text', $note_text) else ''"/>
                  <xsl:value-of select="if (exists($note_w)) then concat('note_w', $note_w) else ''"/>
                  <xsl:value-of select="if (exists($note_x)) then concat('note_x', $note_x) else ''"/>
                  <xsl:value-of select="if (exists($note_y)) then concat('note_y', $note_y) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.notes.edit'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.transform.rotate" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="degrees" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($degrees)) then concat('&amp;degrees=', $degrees) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($degrees)) then concat('degrees', $degrees) else ''"/>
                  <xsl:text>methodflickr.photos.transform.rotate</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.transform.rotate'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photos.upload.checkTickets" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="tickets" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($tickets)) then concat('&amp;tickets=', $tickets) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photos.upload.checkTickets</xsl:text>
                  <xsl:value-of select="if (exists($tickets)) then concat('tickets', $tickets) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photos.upload.checkTickets'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.addPhoto" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photosets.addPhoto</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.addPhoto'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.create" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="title" as="xs:string?" required="yes"/>
      <xsl:param name="description" as="xs:string?" select="()"/>
      <xsl:param name="primary_photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($title)) then concat('&amp;title=', $title) else ''"/>
         <xsl:value-of select="if (exists($description)) then concat('&amp;description=', $description) else ''"/>
         <xsl:value-of select="if (exists($primary_photo_id)) then concat('&amp;primary_photo_id=', $primary_photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($description)) then concat('description', $description) else ''"/>
                  <xsl:text>methodflickr.photosets.create</xsl:text>
                  <xsl:value-of select="if (exists($primary_photo_id)) then concat('primary_photo_id', $primary_photo_id) else ''"/>
                  <xsl:value-of select="if (exists($title)) then concat('title', $title) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.create'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.delete" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photosets.delete</xsl:text>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.delete'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.editMeta" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:param name="title" as="xs:string?" required="yes"/>
      <xsl:param name="description" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:value-of select="if (exists($title)) then concat('&amp;title=', $title) else ''"/>
         <xsl:value-of select="if (exists($description)) then concat('&amp;description=', $description) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($description)) then concat('description', $description) else ''"/>
                  <xsl:text>methodflickr.photosets.editMeta</xsl:text>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
                  <xsl:value-of select="if (exists($title)) then concat('title', $title) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.editMeta'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.editPhotos" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:param name="primary_photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="photo_ids" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:value-of select="if (exists($primary_photo_id)) then concat('&amp;primary_photo_id=', $primary_photo_id) else ''"/>
         <xsl:value-of select="if (exists($photo_ids)) then concat('&amp;photo_ids=', $photo_ids) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photosets.editPhotos</xsl:text>
                  <xsl:value-of select="if (exists($photo_ids)) then concat('photo_ids', $photo_ids) else ''"/>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
                  <xsl:value-of select="if (exists($primary_photo_id)) then concat('primary_photo_id', $primary_photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.editPhotos'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.getContext" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photosets.getContext</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.getContext'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.getInfo" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photosets.getInfo</xsl:text>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.getInfo'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.getList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photosets.getList</xsl:text>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.getList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.getPhotos" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:param name="extras" as="xs:string?" select="()"/>
      <xsl:param name="privacy_filter" as="xs:string?" select="()"/>
      <xsl:param name="per_page" as="xs:integer?" select="()"/>
      <xsl:param name="page" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:value-of select="if (exists($extras)) then concat('&amp;extras=', $extras) else ''"/>
         <xsl:value-of select="if (exists($privacy_filter)) then concat('&amp;privacy_filter=', $privacy_filter) else ''"/>
         <xsl:value-of select="if (exists($per_page)) then concat('&amp;per_page=', $per_page) else ''"/>
         <xsl:value-of select="if (exists($page)) then concat('&amp;page=', $page) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($extras)) then concat('extras', $extras) else ''"/>
                  <xsl:text>methodflickr.photosets.getPhotos</xsl:text>
                  <xsl:value-of select="if (exists($page)) then concat('page', $page) else ''"/>
                  <xsl:value-of select="if (exists($per_page)) then concat('per_page', $per_page) else ''"/>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
                  <xsl:value-of select="if (exists($privacy_filter)) then concat('privacy_filter', $privacy_filter) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.getPhotos'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.orderSets" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_ids" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_ids)) then concat('&amp;photoset_ids=', $photoset_ids) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photosets.orderSets</xsl:text>
                  <xsl:value-of select="if (exists($photoset_ids)) then concat('photoset_ids', $photoset_ids) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.orderSets'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.removePhoto" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photosets.removePhoto</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.removePhoto'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.comments.addComment" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:param name="comment_text" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:value-of select="if (exists($comment_text)) then concat('&amp;comment_text=', $comment_text) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($comment_text)) then concat('comment_text', $comment_text) else ''"/>
                  <xsl:text>methodflickr.photosets.comments.addComment</xsl:text>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.comments.addComment'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.comments.deleteComment" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="comment_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($comment_id)) then concat('&amp;comment_id=', $comment_id) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($comment_id)) then concat('comment_id', $comment_id) else ''"/>
                  <xsl:text>methodflickr.photosets.comments.deleteComment</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.comments.deleteComment'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.comments.editComment" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="comment_id" as="xs:string?" required="yes"/>
      <xsl:param name="comment_text" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($comment_id)) then concat('&amp;comment_id=', $comment_id) else ''"/>
         <xsl:value-of select="if (exists($comment_text)) then concat('&amp;comment_text=', $comment_text) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($comment_id)) then concat('comment_id', $comment_id) else ''"/>
                  <xsl:value-of select="if (exists($comment_text)) then concat('comment_text', $comment_text) else ''"/>
                  <xsl:text>methodflickr.photosets.comments.editComment</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.comments.editComment'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:photosets.comments.getList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photoset_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photoset_id)) then concat('&amp;photoset_id=', $photoset_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.photosets.comments.getList</xsl:text>
                  <xsl:value-of select="if (exists($photoset_id)) then concat('photoset_id', $photoset_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.photosets.comments.getList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:reflection.getMethodInfo" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="method_name" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($method_name)) then concat('&amp;method_name=', $method_name) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.reflection.getMethodInfo</xsl:text>
                  <xsl:value-of select="if (exists($method_name)) then concat('method_name', $method_name) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.reflection.getMethodInfo'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:reflection.getMethods" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.reflection.getMethods</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.reflection.getMethods'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:tags.getHotList" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="period" as="xs:string?" select="()"/>
      <xsl:param name="count" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($period)) then concat('&amp;period=', $period) else ''"/>
         <xsl:value-of select="if (exists($count)) then concat('&amp;count=', $count) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($count)) then concat('count', $count) else ''"/>
                  <xsl:text>methodflickr.tags.getHotList</xsl:text>
                  <xsl:value-of select="if (exists($period)) then concat('period', $period) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.tags.getHotList'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:tags.getListPhoto" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="photo_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($photo_id)) then concat('&amp;photo_id=', $photo_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.tags.getListPhoto</xsl:text>
                  <xsl:value-of select="if (exists($photo_id)) then concat('photo_id', $photo_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.tags.getListPhoto'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:tags.getListUser" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.tags.getListUser</xsl:text>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.tags.getListUser'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:tags.getListUserPopular" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" select="()"/>
      <xsl:param name="count" as="xs:integer?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:value-of select="if (exists($count)) then concat('&amp;count=', $count) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($count)) then concat('count', $count) else ''"/>
                  <xsl:text>methodflickr.tags.getListUserPopular</xsl:text>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.tags.getListUserPopular'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:tags.getListUserRaw" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="tag" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($tag)) then concat('&amp;tag=', $tag) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.tags.getListUserRaw</xsl:text>
                  <xsl:value-of select="if (exists($tag)) then concat('tag', $tag) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.tags.getListUserRaw'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:tags.getRelated" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="tag" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($tag)) then concat('&amp;tag=', $tag) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.tags.getRelated</xsl:text>
                  <xsl:value-of select="if (exists($tag)) then concat('tag', $tag) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.tags.getRelated'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:test.echo" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.test.echo</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.test.echo'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:test.login" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.test.login</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.test.login'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:test.null" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:if test="true() or exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.test.null</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.test.null'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:urls.getGroup" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="group_id" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($group_id)) then concat('&amp;group_id=', $group_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:value-of select="if (exists($group_id)) then concat('group_id', $group_id) else ''"/>
                  <xsl:text>methodflickr.urls.getGroup</xsl:text>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.urls.getGroup'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:urls.getUserPhotos" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.urls.getUserPhotos</xsl:text>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.urls.getUserPhotos'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:urls.getUserProfile" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="user_id" as="xs:string?" select="()"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($user_id)) then concat('&amp;user_id=', $user_id) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.urls.getUserProfile</xsl:text>
                  <xsl:value-of select="if (exists($user_id)) then concat('user_id', $user_id) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.urls.getUserProfile'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:urls.lookupGroup" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="url" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($url)) then concat('&amp;url=', $url) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.urls.lookupGroup</xsl:text>
                  <xsl:value-of select="if (exists($url)) then concat('url', $url) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.urls.lookupGroup'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
   <xsl:template name="f:urls.lookupUser" as="element()">
      <xsl:param name="api_key" as="xs:string?" select="$f:api_key"/>
      <xsl:param name="url" as="xs:string?" required="yes"/>
      <xsl:variable name="uriparams">
         <xsl:value-of select="if (exists($api_key)) then concat('&amp;api_key=', $api_key) else ''"/>
         <xsl:value-of select="if (exists($url)) then concat('&amp;url=', $url) else ''"/>
         <xsl:if test="exists($f:auth_token)">
            <xsl:text>&amp;auth_token=</xsl:text>
            <xsl:value-of select="$f:auth_token"/>
            <xsl:text>&amp;api_sig=</xsl:text>
            <xsl:call-template name="f:flickr.auth">
               <xsl:with-param name="sig">
                  <xsl:value-of select="if (exists($api_key)) then concat('api_key', $api_key) else ''"/>
                  <xsl:text>auth_token</xsl:text>
                  <xsl:value-of select="$f:auth_token"/>
                  <xsl:text>methodflickr.urls.lookupUser</xsl:text>
                  <xsl:value-of select="if (exists($url)) then concat('url', $url) else ''"/>
               </xsl:with-param>
            </xsl:call-template>
         </xsl:if>
      </xsl:variable>
      <xsl:call-template name="f:flickr">
         <xsl:with-param name="method" select="'flickr.urls.lookupUser'"/>
         <xsl:with-param name="uriparams" select="$uriparams"/>
      </xsl:call-template>
   </xsl:template>
</xsl:stylesheet>