Suppose I have an Anti-XML object, e.g.:
import com.codecommit.antixml._
val child = <child attr="val">...</child>.convert
I want to construct an XML object that contains child
as a child:
<parent foo="bar"><foo/><child attr="val">...</child><foo/></parent>
The obvious way would be
val parent : Elem = <parent foo="bar"><foo/>{ child }<foo/></parent>.convert
The problem is that Scala's XML literals don't recognize Anti-XML's objects, so child
gets converted to a string, and embedded in parent
as a text node:
<parent foo="bar"><foo/><child attr="val">...</child><foo/></parent>
How can I work around this issue?