I have an xml alone, I wanted to add a markup outside of a tag called scl
so for example
<documents>
<rnl></rnl>
<snl></snl>
<scl>This is scl</scl>
</documents>
So <scl>This is scl</scl
> will be transformed to <credit><scl>This is scl</scl></credit>
How do I modify the below to achieve this ? So far I have tried.
String content5 = "<scl>this is scl</scl>";
System.out.println(content5.replaceAll("^(?:<scl>)(?:.*?)(?:</scl>)", "<credit>$1</credit>" ));