Added XML parsing instead of regex