Hi,
I use the following code to convert a org.w3c.dom.Document object to xml file.
public void domToInputStream(Document doc, String _strFilePat)
{
TransformerFactory transFactory = TransformerFactory.newInstance(); 
Transformer transFormer = transFactory.newTransformer();
DOMSource domSource = new DOMSource(doc); 
File file = createNewFile(_strFilePath); 
FileOutputStream out = new FileOutputStream(file); 
StreamResult xmlResult = new StreamResult(out); 
transFormer.transform(domSource, xmlResult);
}

But errors:
net.sf.saxon.trans.XPathException: Undeclared namespace in :name at net.sf.saxon.dom.DOMSender.outputElement(DOMSender.java:214) at net.sf.saxon.dom.DOMSender.walkNode(DOMSender.java:145) at net.sf.saxon.dom.DOMSender.outputElement(DOMSender.java:228) at net.sf.saxon.dom.DOMSender.walkNode(DOMSender.java:145) at net.sf.saxon.dom.DOMSender.outputElement(DOMSender.java:228) at net.sf.saxon.dom.DOMSender.walkNode(DOMSender.java:145) at net.sf.saxon.dom.DOMSender.outputElement(DOMSender.java:228) at net.sf.saxon.dom.DOMSender.walkNode(DOMSender.java:145) at net.sf.saxon.dom.DOMSender.outputElement(DOMSender.java:228) at net.sf.saxon.dom.DOMSender.walkNode(DOMSender.java:145) at net.sf.saxon.dom.DOMSender.send(DOMSender.java:97) at net.sf.saxon.dom.DOMObjectModel.sendSource(DOMObjectModel.java:112) at net.sf.saxon.event.Sender.send(Sender.java:218) at net.sf.saxon.IdentityTransformer.transform(IdentityTransformer.java:29) at common.TranslatorUtils.domToInputStream(TranslatorUtils.java:347)

 Undeclared namespace in :name, is a Chinese character.

If I replace saxon9.jar and saxon9-dom.jar with Xalan.jar, there is no errors.

If I use Jdom(http://www.jdom.org/) to implement the function "domToInputStream", there is no errors, too.
public void domToInputStream(Document doc, String _strFilePat)
{   
DOMBuilder builder = new DOMBuilder();   
XMLOutputter xml = new XMLOutputter();   
String s = xml.outputString(builder.build(document));
 ..........
}

I have read the following email.
http://comments.gmane.org/gmane.text.xml.saxon.help/7090
 ":name"(Chinese) is not a legal attribute name?
Thanks.