http://www.alphaworks.ibm.com/tech/xmlsecuritysuite
enc.XMLCipher2 reads an XML document and encrypts the part of it specified by an XPath expression using a template file:
% java enc.XMLCipher2 -e keyinfo.xml hotcop.xml /SONG/PUBLISHER template1.xml
API
http://xml.apache.org/security/
http://jcp.org/jsr/detail/106.jsp