I got a pretty basic question but don't seem to find the elegant Scala way of doing this.
I want to insert programatically generated XML tags into an existing XML structure that I read in from a file using
xml.XML.loadFile(...)
In How do I create an XML root node in Scala without a literal element name? I found this approach for creating my tags.
def textElem(name: String, text: String) = Elem(null, name, Null, TopScope, Text(text))
Having the XML tree
<root>
<set start="christmas">
<data>
<val>ABC</val>
...
</data>
<custom>
<entry>DEF</entry>
<!-- APPEND HERE -->
</custom>
</set>
<set start="halloween">
...
</set>
</root>
How do I select the custom section from the christmas set, append my programatically generated XML tags and save the whole XML tree back to a file?
Thanks for your Help!