What are you using to parse the XML content and then modify it? I wouldsuggest either JDOM ( http://www.jdom.org/ ) or Dom4J (http://www.dom4j.org/ ). They are both packages which help make iteasier to use xml documents from within Java.