Make xml_server method more flexible