polish methods in xml_control
add unit tests