For example:
XML:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="example.xsl"?>
<document>
<foo>bar</foo>
</document>
XSL:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>example</title>
<script type="text/javascript">
/* magic javascript that alters the foo-node to contain something else */
</script>
</head>
<body>
<p>Foo: <xsl:value-of select="foo" /></p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I want that javascript to modify the XML DOM, NOT the HTML DOM!
It’s impossible, and even if it were possible, I have no idea what you’d expect it to do.
The XML has already been transformed for display, the XSLT doesn’t keep updating the view in real time.
View Source in a browser will only show the source as-sent, rather than a serialisation of the DOM as-modified.
Debuggers such as Firebug will show a serialisation of the DOM as displayed, in the browser (i.e. the transformed DOM, plus any scripted modifications).