  	public:
  		XMLElementImpl(DOMElement* element)
  		{
-@@ -483,21 +486,22 @@ namespace XMLUtils
+@@ -478,26 +481,31 @@ namespace XMLUtils
+ 
+ 		string ToString(bool incRoot = false) const
+ 		{
++            //cout << "XMLElementImpl::ToString " << incRoot << endl;
++            //cout << "GetTextValue (): " << GetTextValue () << endl;
+ 			if(!incRoot && IsLeafNode())
+ 			{
  				return GetTextValue();
  			}
++            
++            
  			string xml = "";
 -			DOMWriter* writer = NULL;
 +			DOMLSSerializer* writer = NULL;

 				XStr xstr1, xstr2;
 				DOMImplementation* impl =  DOMImplementationRegistry::getDOMImplementation(xstr1.X("LS"));							
-				writer = ((DOMImplementationLS*)impl)->createDOMWriter();
+				writer = ((DOMImplementationLS*)impl)->createLSSerializer();
+                DOMConfiguration* dc = writer->getDomConfig(); 
+                //dc->setParameter(XMLUni::fgDOMErrorHandler,errorHandler); 
+                dc->setParameter(XMLUni::fgDOMWRTDiscardDefaultContent,true);
+                
 				if(writer)
 				{
 					dest = new MemBufFormatTarget();
-					writer->setEncoding(xstr2.X("UTF-8"));
+					//writer->setEncoding(xstr2.X("UTF-8"));
 					if(!incVersionStr)
 					{
-						writer->setFeature(XMLUni::fgDOMXMLDeclaration, false);
+						//writer->setFeature(XMLUni::fgDOMXMLDeclaration, false);
 					}
-					writer->writeNode(dest, *doc);
-					xml = (char*)((MemBufFormatTarget*)dest)->getRawBuffer();
+					//writer->writeNode(dest, *doc);
+					//xml = (char*)((MemBufFormatTarget*)dest)->getRawBuffer();
+                    xml = (char*)writer->writeToString (doc);
+                    
+                    cout << "ToString: " << xml << endl;
 				}
 			}
 			catch (XMLException& e)

===================================================================
--- libamt.orig/intel/src/XMLUtils_XRCS.cpp
+++ libamt/intel/src/XMLUtils_XRCS.cpp
@@ -13,7 +13,7 @@
 #include <xercesc/util/PlatformUtils.hpp>
 #include <xercesc/util/XMLString.hpp>
 #include <xercesc/dom/DOM.hpp>
-#include <xercesc/dom/DOMWriter.hpp>
+#include <xercesc/dom/DOMLSSerializer.hpp>
 #include <xercesc/dom/DOMImplementationRegistry.hpp>
 #include <xercesc/dom/DOMImplementationLS.hpp>
 #include <xercesc/util/OutOfMemoryException.hpp>
@@ -23,6 +23,9 @@
 #include <xercesc/util/XMLUni.hpp>
 #include <xercesc/framework/MemBufFormatTarget.hpp>
 
+
+#include <iostream>
+
 XERCES_CPP_NAMESPACE_USE
