xmlspy tools can do this.
but in java, u can try jaxb
JavaTM Architecture for XML Binding
README
Specification Version: 1.0
Reference Implementation (RI) Version: 1.0
JavaTM Architecture for XML Binding (JAXB) provides an API and tools that automate the mapping between XML documents and Java objects.
JAXB makes XML easy to use by compiling an XML schema into one or more Java technology classes. The combination of the schema derived classes and the binding framework enable one to perform the following operations on an XML document:
unmarshal XML content into a Java representation
access, update and validate the Java representation against schema constraints
marshal the Java representation of the XML content into XML content