Null Pointer check for xml_len.

Cannot dereference xml_len before Null check.
Use same as done on line no : 4043
Merge pull request #12 from ya1gaurav/patch-12

Null Pointer check for xml_len.