After parsing the documengt I am getting null, even though the document contains data. Here is my code, I have set all validations to false.
DocumentBuilderF
[#document: null] is just the toString of your doc instance, it doesn't output your whole XML document.
[#document: null]
doc
The instance itself is not null, you can probably continue your processing without a problem.