fixed several bugs, added XML support