code for xml demo improved and javadoc completed

code for xml demo improved and javadoc completed