Create and Sign a document in XAdes format

I have been checking the Sign API, which allows creating document to be assigned or send for signing. How do I create a document and sign it for submission or sharing to others?

So basically I need to sign a doc (i.e. base64 encoded / XAdes format), how do I do that via Signicat API?