Lux is an open source XML search engine formed by fusing two excellent technologies: the Apache Lucene/Solr search index and the Saxon XQuery/XSLT processor.
Lux extends Solr's HTTP REST API to provide XML indexing for documents inserted via the Solr update API, and XQuery processing via the Solr search API.
Lux provides an XQuery function library. This include functions related to searching and storing documents in the index.
The Lux internals are described here. Read thi if you are going to embed Lux in another Java application.