The Velocity docs will be better to explain this, as I really don't
understand it well.
However, as I understand it, Velocity loads globally-scoped macros from
a single file, which in XWiki is macros.vm, located in the /templates
directory.
And, in case you don't already know it, the instructions - such as they
are - are available at 
velocity.apache.org (to my mind, the site is
organized a little oddly:  from the main page's left-side menu you have
to pick "Engine" from the "Development" submenu, which gets you to a
page whose left menu has a "Docs" section, under which "User Guide"
and
"VTL Reference" are the most useful, particularly the latter).
brain[sic]
  -----Original Message-----
 From: roopesh(a)digitalglue.in [mailto:roopesh@digitalglue.in]
 Sent: Wednesday, April 25, 2007 2:19 AM
 To: xwiki-users(a)objectweb.org
 Subject: [xwiki-users] How to create a macro ?
 Hi
 How can I create my own macro in my xwiki (say, a macro for
 adding two numbers). Where should I write it. So that I can
 use it from any page ?
 Regards
 Roopesh