If I wanted to transform your original XML into your target XML, I would just use XSLT to do that. Should be pretty simple. But you said you were using XML Beans, and I know nothing about that, so I didn't answer.
Yeah, but is it art? What do you think tiny ad?
a bit of art, as a gift, that will fit in a stocking