Move the check into dependent call
diff --git a/tinyxml2.h b/tinyxml2.h
index 35da4d9..cf26cdd 100755
--- a/tinyxml2.h
+++ b/tinyxml2.h
@@ -2068,7 +2068,7 @@
     virtual void PrintSpace( int depth );

     void Print( const char* format, ... );

 

-	void SealElement();

+    void SealElementIfJustOpened();

     bool _elementJustOpened;

     DynArray< const char*, 10 > _stack;