Is there a better way to do this. May be through xml parsing ?

In any case probably you wanted to use "coordinator.xml" instead of "coordinator.xm".