Unify node deletion
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
index 1717e0a..1ef24ed 100755
--- a/tinyxml2.cpp
+++ b/tinyxml2.cpp
@@ -991,7 +991,7 @@
                 // Set error, if document already has children.

                 if ( !_document->NoChildren() ) {

                         _document->SetError( XML_ERROR_PARSING_DECLARATION, decl->Value(), 0);

-                        DeleteNode( decl );

+                        DeleteNode( node );

                         break;

                 }

         }