You've given us nowhere near enough detail to diagnose this. Start by telling us what the actual difference is between your two documents and why you think it's a problem
(Though it sounds like an XMLSpy issue rather than a Xalan issue, since you said the file changes only when you load it in XMLSpy and save it again.)
