Hi Asxetos,
Here a quick code snippet I put together: http://sprunge.us/jdaZ ( or http://sprunge.us/OZHj?xquery )
If you use db:replace, you should probably specify your document inside the query.
However, the REST API may be more appropriate for your scenario. Did you already have a look at our documentation [1]? If you want to send your request via XQuery, you can use the HTTP Module [2].
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Developer_Section [2] http://docs.basex.org/wiki/HTTP_Module
If there's a better method for doing what I am trying, I'm fine with replacing my whole method, even if that is using some sort of REST API and http requests. Just give me some pointers ;)
Thanks!