I'm new to bitcoin programming and decided to give it a try with the release of bitcoinjs-lib 1.0. Here is how I generate the hex for the transaction
var bitcoin = require('bitcoinjs-lib');
var key = bitcoin.ECKey.fromWIF("cS4fb6sHrJ2VrfqRNBkk6eHMCB5PY6Bayyo695VaSdfZLMbPZiGv");
var tx = new bitcoin.Transaction();
tx.addInput("129aa78e5649715ecc7121aee0cdba06527061976be9c38c3a9fd9ae258665c3", 0);
tx.addOutput("msj42CCGruhRsFrGATiUuh25dtxYtnpbTx", 15000)
tx.sign(0, key)
console.log(tx.toHex())
and here is the hex output
0100000001c3658625aed99f3a8cc3e96b9761705206bacde0ae2171cc5e7149568ea79a12000000006b483045022100e807c222e6f53795d1fa5fcef7e50176e5a2cd9c164a9c955a5e717544a0ef250220743c40908d190bd13c407b8dbbf0dd2d685858c34bc998ee99e4de9f4e9eb2830121023cb4fea046a3747ee2e966ac382435cfca4570f959bcccb6b680fdcc812e15b9ffffffff01983a0000000000001976a91485eb47fe98f349065d6f044e27a4ac541af79ee288ac00000000
I looked through the lib but couldn't find where to inject the bitcoin.networks.testnet object and the documentation is empty