  					}
  					else
  					{
-@@ -505,10 +509,12 @@ namespace XMLUtils
+@@ -505,10 +513,12 @@ namespace XMLUtils
  						{
  							if(child->getNodeType() == DOMNode::ELEMENT_NODE)
  							{

===================================================================
--- libamt.orig/intel/src/XMLUtils_XRCS.cpp
+++ libamt/intel/src/XMLUtils_XRCS.cpp
@@ -13,7 +13,8 @@
 #include <xercesc/util/PlatformUtils.hpp>
 #include <xercesc/util/XMLString.hpp>
 #include <xercesc/dom/DOM.hpp>
-#include <xercesc/dom/DOMWriter.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 +24,8 @@
 #include <xercesc/util/XMLUni.hpp>
 #include <xercesc/framework/MemBufFormatTarget.hpp>
 
+#include <iostream>
+
 XERCES_CPP_NAMESPACE_USE

 				XStr xstr1, xstr2;
 				DOMImplementation* impl =  DOMImplementationRegistry::getDOMImplementation(xstr1.X("LS"));							
-				writer = ((DOMImplementationLS*)impl)->createDOMWriter();
-				if(writer)
-				{
-					dest = new MemBufFormatTarget();
-					writer->setEncoding(xstr2.X("UTF-8"));
-					if(!incVersionStr)
-					{
-						writer->setFeature(XMLUni::fgDOMXMLDeclaration, false);
-					}
-					writer->writeNode(dest, *doc);
-					xml = (char*)((MemBufFormatTarget*)dest)->getRawBuffer();
-				}
+				writer = ((DOMImplementationLS*)impl)->createLSSerializer();
+                DOMLSOutput* theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
+                
+                //DOMConfiguration* dc = writer->getDomConfig(); 
+                //dc->setParameter(XMLUni::fgDOMErrorHandler,errorHandler); 
+                //dc->setParameter(XMLUni::fgDOMWRTDiscardDefaultContent,true);
+ 
+ 				if(writer)
+				{
+					//writer->setEncoding(xstr2.X("UTF-8"));
+					//if(!incVersionStr)
+					//{
+                    //    writer->setFeature(XMLUni::fgDOMXMLDeclaration, false);
+					//}
+
+                    auto pTarget = new MemBufFormatTarget();
+                    theOutput->setByteStream (pTarget);
+					
+                    writer->write (doc, theOutput);
+                    xml = pTarget->getRawBuffer();
+                    
+                    result = string ((char*) xml);
+                    //cout << "ToString: " << xml << endl << result << endl;
+                    
+                    delete pTarget;
+                }
+                
+                theOutput->release ();
+                
+                
 			}
 			catch (XMLException& e)
 			{
@@ -832,7 +865,7 @@ namespace XMLUtils
 			{
 				delete dest;
 			}
-			return xml;
+			return result;
 		}
 	private:
 		XMLDocImpl(const XMLDocImpl& other){}
