added check for empty xml.