I wan to replace a node in XML document with another and as a consequence replace all it\'s children with other content. Following code should work, but for an unknown reaso
Easy way to do is using regular expression.
String payload= payload.replaceAll("([^<]*)", "NODATA");
This will make sure all the payload nodes contents are replaced with NODATA