I'm going to give you just a brief overview of what a digitally signed XML document looks like. The arithmetic is far too complex for most humans to do by hand (even programmers). It's virtually certain that you'll use some software application or library to sign and verify your documents. XML documents aren't signed by hand.
There are three basic kinds of signatures.
An enveloping signature contains the data it signs.
An enveloped signature is contained inside the document it signs.
A detached signature signs data external to the document identified by a URL.
Before any XML document can be signed, it needs to be transformed into a canonical form that normalizes syntactically irrelevant details like attribute order and ...