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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.