The source file contains
Hello World, this is a nice world
The output desired applying the XSLT to the input file:
It is not possible for the input document to be plain text because the input to an XSLT 1.0 transformation must be well-formed XML.
Here are some alternative ways to access plain text in an XSLT transformation:
Here's an example of the external entity technique:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wrapper [
<!ENTITY textFile SYSTEM "file.txt">
]>
<wrapper>&textFile;</wrapper>
(Note that this last option could be challenging given XSLT 1.0's limited string processing abilities, but for some data, it may be viable.)