Index: /OpenSceneGraph/trunk/src/osgDB/XmlParser.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgDB/XmlParser.cpp (revision 10921)
+++ /OpenSceneGraph/trunk/src/osgDB/XmlParser.cpp (revision 10928)
@@ -227,5 +227,5 @@
 
             int c = 0;
-            while ((c=input[0])>=0 && c!=' ' && c!='>' )
+            while ((c=input[0])>=0 && c!=' ' && c!='>' && c!='/')
             {
                 childNode->name.push_back(c);
@@ -233,5 +233,5 @@
             }
 
-            while ((c=input[0])>=0 && c!='>')
+            while ((c=input[0])>=0 && c!='>' && c!='/')
             {
                 Input::size_type prev_pos = input.currentPosition();
@@ -240,5 +240,5 @@
                 std::string option;
                 std::string value;
-                while((c=input[0])>=0 && c!='>' && c!='"' && c!='\'' && c!='=' && c!=' ')
+                while((c=input[0])>=0 && c!='>' && c!='/' && c!='"' && c!='\'' && c!='=' && c!=' ')
                 {
                     option.push_back(c);
@@ -296,5 +296,5 @@
             }
 
-            if ((c=input[0])>=0 && c=='>' )
+            if ((c=input[0])>=0 && c=='>' || c=='/')
             {
                 ++input;
@@ -302,6 +302,19 @@
                 osg::notify(osg::INFO)<<"Valid tag ["<<childNode->name<<"]"<<std::endl;
 
-                bool result = childNode->read(input);
-                if (!result) return false;
+                if (c=='/')
+                {
+                    if ((c=input[0])>=0 && c=='>')
+                    {
+                        ++input;
+                        osg::notify(osg::INFO)<<"tag is closed correctly"<<std::endl;
+                    }
+                    else 
+                        osg::notify(osg::NOTICE)<<"Error: end tag is not closed correctly"<<std::endl;
+                }
+                else
+                {
+                    bool result = childNode->read(input);
+                    if (!result) return false;
+                }
 
                 if (type==NODE && !children.empty()) type = GROUP;
@@ -388,16 +401,23 @@
                 fout<<"\"";
             }
-            fout<<">";
-
-            for(Children::const_iterator citr = children.begin();
-                citr != children.end();
-                ++citr)
-            {
-                (*citr)->write(fout);
-            }
-
-            if (!contents.empty()) writeString(fout,contents);
-
-            fout<<"</"<<name<<">"<<std::endl;
+
+            if (children.empty())
+            {
+                fout<<" />"<<std::endl;
+            }
+            else
+            {
+                fout<<">";
+                for(Children::const_iterator citr = children.begin();
+                    citr != children.end();
+                    ++citr)
+                {
+                    (*citr)->write(fout);
+                }
+
+                if (!contents.empty()) writeString(fout,contents);
+
+                fout<<"</"<<name<<">"<<std::endl;
+            }
             return true;
         }
