The critical step is, how I can load not the whole class, but just
several "IF-THEN-Statements" in the class at run time.
There are several ways you can do it.
You generate Java source code, then compile it. The source code would
be for a class that overrides your main class. It may have just one
method in it that does the if-then logic, and whatever else minimally
must exist in the method to get it started.
The other option is to generate JVM byte code on the fly. See
http://mindprod.com/jgloss/jasm.html. This is more difficult, but then
you bypass the compile step. You may be forced to use this approach
where you cannot guarantee the presence of the latest and greatest
Javac.exe at run time.
See
http://mindprod.com/jgloss/javacexe.html for how to invoke javac
without firing up a new JVM (much faster).
I would be happy to write the part that converts the XML either to
Java or byte code for a fee if you feel overwhelmed.
You might want to build these conditions visually with drag and drop.
The advantage there is it impossible to make syntax or other
grammatical errors.
You might want to invent a simplified language for describing them.
You then need a parser. see
http://mindprod.com/jgloss/parser.html
The great advantage of generating java source code is you can always
create an escape in your specification language to allow tricky cases
to be specially handled with custom Java code.
You would find that raw XML would be even more confusing, and
certainly more bulky than the raw Java itself. XML would just be your
intermediate target.