To add your own extension you need to do the following things.
Write code that implements your extension functionality.
The easiest place to start is by looking at the code in org.apache.fop.extension.
Create a jar file with your classes, it must also include the following file "/META-INF/services/org.apache.fop.fo.ElementMapping". In this file you need to put the fully qualified classname of your element mappings class. This class must implement the "org.apache.fop.fo.ElementMapping" interface.
Put your jar file in the classpath and then run fop over the fo file.