I'm retrieving a String value from a database that is in XML format an example of the String:
<TXNURN>3505</TXNURN><CH></CH><REQ>N</REQ><DOB></DOB><QT>2</QT><DR>TAGER00</DR><NUMBER>N</NUMBER>
In the webpage it is displayed like this(since of course XML tags are invisible in HTML page):
3505N2TAGER00N
What I would like to do, is create a java class/function that will take the String, and format it so that the output on the HTML page would look something like this:
TXNURN: 3505
CH:
REQ: N
DOB:
QT: 2
DR: TAGER00
NUMBER: N
I know there are plenty of methods that can format Strings and characters, but I just can't seem to wrap my head around on how to use them effectively in getting the result that I want. I don't ever have to format Strings you see...
Any help would greatly be appreciated! Thanks in advance.
---------------------------------------------------------- Update ---------------------------------------------------------------
I see now that all I realy have to do is put a line feed after every closing tag . But the question remains... How?