I have a String which has xml markup within it. I need to append this String as XML encoded text within a SOAP Body. javax.xml.soap.SOAPElement has the addTextNode(String) method but all the markup is encoded with escape sequences instead. Does anyone know how to encode this properly? Thanks.
-Ahmad<br />Sun Certified Java Developer (SCJD)<br />Sun Certified Java Programmer (SCJP)<p>"You got to be careful if you don't know where you're going, because you might not get there." -Yogi Berra
Thanks for the response Lasse. I have indeed tried addChildElement(). However, this method assumes that the string is the tag name, and thus adds < and /> at the beginning and end of my string. I did in fact solve my problem by essentially writing a recursive deep copy method which starts at the root element and appends each child element and its child element and so forth with its attributes, namespaces, and content. Works great. You would think that a nice method would be provided within the SAAJ or the JAXM libraries. If there is, I couldn't find it.