This matches Elems with one child. :)
If you want to match any number of children, replace the last "_" with "_*" . All part of the magic of unapplySeq. :)
<foo id="bar"/> match { // prints "bar"
case n @ <foo/> if (n \ "@id" text) == "bar" => println("bar")
case n @ <foo/> if (n \ "@id" text) == "baz" => println("baz")
}