No, the approach you are proposing is the mainstream approach when you need to preserve physical details of the source XML that aren't retained in the XDM model.
 
Andrew Welch has a tool that productizes the approach:
 
http://andrewjwelch.com/lexev/
 
Michael Kay
http://www.saxonica.com/


From: Todd Gochenour [mailto:todd.gochenour@gmail.com]
Sent: 22 April 2009 10:29
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] XPath result different between XALAN and SAXON

My handy-dandy XSL transformation fails to preserve <!DOCTYPE> declarations and &entity; usage as the XML parser reading the source XSL document expands entities before the transformer sees the content.
 
There doesn't seem to be a reasonable solution using standard tools.
 
The solution I'm considering now is to preprocess the file and turn <!DOCTYPE> and entities into processing instructions, do the transformation, and then postprocess the result to convert the processing instructions back to <!DOCTYPE> and entities.
 
Is there a better strategy that I'm not seeing?