You can use XSLT which will take a XSL stylesheet and use it to transform a given XML document into HTML. In this case, I am assuming you would want the tag/element names as static text next to text input boxes where the user could change the values. You would then use the HTML form to POST to your Servlet, where the values could be used to modify the document's content. To do the last bit, you will need to understand DOM (aka JAXP in Java).
There are extensive tutorials on both XSLT and DOM at Apache, W3C and here at Sun.
- Saish