clean up Value of XMLDocument
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index cefd22d..e007294 100755
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -645,6 +645,9 @@
 

 const char* XMLNode::Value() const 

 {

+    // Catch an edge case: XMLDocuments don't have a a Value. Carefully return nullptr.

+    if ( this->ToDocument() )

+        return 0;

     return _value.GetStr();

 }