# The identity transform: duplicates the input to output
TRANSFORM = """
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
SOURCE = """<spam id="eggs">I don't like spam</spam>"""
# The processor class is the core of the XSLT API
from Ft.Xml.Xslt import Processor
processor = Processor.Processor()
# We use the InputSource architecture
from Ft.Xml import InputSource
# Prepare an InputSource for the transform
transform = InputSource.DefaultFactory.fromString(TRANSFORM,
"http://spam.com/identity.xslt")
# Prepare an InputSource for the source document
source = InputSource.DefaultFactory.fromString(SOURCE,
"http://spam.com/doc.xml")
processor.appendStylesheet(transform)
result = processor.run(source)
# result is a string with the serialized transform result
print result