Fix XML queries