The mechanics of converting it into xml are easy enough, either you write a general parser, parse it to a string and then convert (which is easy but means you would have to validate it) with a document reader, or you generate the xml as you go along (more complicated but cuts down validation).
The problem from your example above is defining what you will allow in your language:
Lorem\B ipsum\I dolor\B sit \COLOR=RGB(255,0,0)amet\COLOR
Is this supposed to come out as
Lorem<b> ipsum<i> dolor</b> sit<color>=rgb(255,0,0)amet</color>
or
Lorem<b> impsum</b><i> dolor</i><b> sit</b><color>RGB(255,0,0)amet</color><color>
Neither seem particulrly what you would want, the first isn't valid, the second means you could just make one word bold (and never bold and italic).
It seems to be going back towards sgml where you need an additional file to know what is permitted.
But the easiest way for you to test it would just be to make a parser and load the results into a stringbuilder, then when you are done you just need to do something like
StringBuilder stringbuilder = new StringBuilder();
...
// parse the input string into the stringbuilder
...
String xml = stringbuilder.toString();
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(new InputSource(new StringReader(xml)));
will give you the answer in a dom if you wanted that (or throw an exception if you used that string above)