Null Pointer check for xml_len.

Cannot dereference xml_len before Null check.
Use same as done on line no : 4043