Looking for an XML Editor with API for a Wizard project

Hi all- I want to write a UI that will let our users build XML templates. These templates represent screen widgets and contain the basic html components (Input, Button etc) and some custom definitions. I would like the UI to be as user friendly as possible. Our clients that are comfortable with building their own XML won't need it.

What I would like ideally is an opensource (but other is ok if it has lots of cool functionality) package with a Java API that will let me customize the UI. Any suggestions? thanks! Max