While there usually is another way with perl, this time there is another way with the xslt. This is the xpath will select only the @type where the string is set to "audio/ogg" and then only display the first one.
&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet xmlns:xsl="https://www.w3.org/1999/XSL/Transform" xmlns:exslt="https://exslt.org/common" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/" xmlns:georss="https://www.georss.org/georss" xmlns:geo="https://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="https://search.yahoo.com/mrss/" version="1.0" extension-element-prefixes="exslt"&gt;
  &lt;xsl:output omit-xml-declaration="yes" indent="no" method="text"/&gt;
  &lt;xsl:template match="/"&gt;
    &lt;xsl:for-each select="/rss/channel/item/enclosure[@type=&quot;audio/ogg&quot;][1]"&gt;
      &lt;xsl:call-template name="value-of-template"&gt;
        &lt;xsl:with-param name="select" select="@url"/&gt;
      &lt;/xsl:call-template&gt;
      &lt;xsl:value-of select="'&#10;'"/&gt;
    &lt;/xsl:for-each&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template name="value-of-template"&gt;
    &lt;xsl:param name="select"/&gt;
    &lt;xsl:value-of select="$select"/&gt;
    &lt;xsl:for-each select="exslt:node-set($select)[position()&gt;1]"&gt;
      &lt;xsl:value-of select="'&#10;'"/&gt;
      &lt;xsl:value-of select="."/&gt;
    &lt;/xsl:for-each&gt;
  &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
