'(xsl:stylesheet (attributes (version "1.0")) (output (attributes (method "text") (indent "yes"))) (strip-space (attributes (elements "*"))) (template (attributes (match "/")) (apply-templates)) (template (attributes (match "*")) (choose (when (attributes (test "ancestor::*")) (text) (for-each (attributes (select "ancestor::*")) (text))) (otherwise (text "'"))) (text "(") (value-of (attributes (select "name()"))) (if (attributes (test "@*")) (text " (attributes") (apply-templates (attributes (select "@*"))) (text ")")) (apply-templates) (text ")") (if (attributes (test "position() != last()")) (text))) (template (attributes (match "@*")) (text " (") (value-of (attributes (select "name()"))) (apply-templates) (text ")")) (template (attributes (match "text()") (priority "1")) (text " \"") (call-template (attributes (name "escape")) (with-param (attributes (name "input") (select ".")))) (text "\"")) (template (attributes (name "escape") (match "text()")) (param (attributes (name "input") (select "."))) (choose (when (attributes (test "contains($input, '\\')")) (call-template (attributes (name "escape")) (with-param (attributes (name "input") (select "substring-before($input, '\\')")))) (text "\\\\") (call-template (attributes (name "escape")) (with-param (attributes (name "input") (select "substring-after($input, '\\')"))))) (when (attributes (test "contains($input, '\"')")) (value-of (attributes (select "substring-before($input, '\"')"))) (text "\\\"") (call-template (attributes (name "escape")) (with-param (attributes (name "input") (select "substring-after($input, '\"')"))))) (otherwise (value-of (attributes (select "$input")))))))