# Varargs matching for empty collections

**URL:** <https://users.scala-lang.org/t/varargs-matching-for-empty-collections/12177>\
**Category:** Question\
**Created:** [January 12, 2026, 10:21pm UTC](https://users.scala-lang.org/t/varargs-matching-for-empty-collections/12177 "2026-01-12T22:21:13Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Sporarum](https://users.scala-lang.org/user_avatar/users.scala-lang.org/sporarum/32/3012_2.png) [@Sporarum](https://users.scala-lang.org/u/Sporarum)\
**Post date:** [January 13, 2026, 7:28pm UTC](https://users.scala-lang.org/t/varargs-matching-for-empty-collections/12177/2 "2026-01-13T19:28:43Z")

</div>

Hello,  
I’m having trouble replicating your example, what version of Scala and which libraries are you using ?

In general I would advise against using XML litterals, as they are slowly being deprecated.

There are now string interpolators which are a more general way of doing these kinds of embedded language operations:

> **[String Interpolation](https://docs.scala-lang.org/scala3/book/string-interpolation.html#custom-interpolators)**
>
> This page provides more information about creating strings and using string interpolation.

They also do support pattern matching (but this is only documented in its [SIP](https://docs.scala-lang.org/sips/11.html) …)

And in particular there are these library-defined string interpolators for XML (which I have not tested, and am not sure are still maintained):

> **[GitHub - akhileshs/XML\_Interpolator: XML String Interpolator for Scala](https://github.com/akhileshs/XML_Interpolator)**
>
> XML String Interpolator for Scala

> **[GitHub - lampepfl/xml-interpolator: XML String Interpolator for Dotty](https://github.com/lampepfl/xml-interpolator)**
>
> XML String Interpolator for Dotty

(see also [Scala 3 xml string interpolator](https://users.scala-lang.org/t/scala-3-xml-string-interpolator/10437))

Personally I think more should be done to ensure we have a suitable replacement to XML literals

---

_[View the full topic](https://users.scala-lang.org/t/varargs-matching-for-empty-collections/12177)._
