Test file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<top>
<a>
  <b u="kalle">B1</b>
</a>
<a>
  <b>B2</b>
  <c>C1<b>B3</b></c>
</a>
<m>
Some text here..
</m>
<multi u="groda" id="150"/>
<multi u="kalle" id="150"/>
</top>

Look for node sequence "top->a" (levelwise). Display from level 1.
jensl:~/c/xmlclitools> xmlgrep -f test.xml 1 top.a
<a><b u="kalle">B1</b></a>
<a><b>B2</b><c>C1<b>B3</b></c></a>

Look for node sequence "top->a->b" (levelwise). Display from level 1.
jensl:~/c/xmlclitools> xmlgrep -f test.xml 1 top.a.b
<a>    <b u="kalle">B1</b>  </a>
<a>    <b>B2</b>  </a>

Look for node sequence "top->a->b" (levelwise). Display from level 2.
jensl:~/c/xmlclitools> xmlgrep -f test.xml 2 top.a.b
<b u="kalle">B1</b>
<b>B2</b>

Look for node named "b" anywhere (g switch) in the tree. Display from 0 levels down.
jensl:~/c/xmlclitools> xmlgrep -gf test.xml 0 b        
<b u="kalle">B1</b>
<b>B2</b>
<b>B3</b>

Look for node "c" anywhere in tree.
jensl:~/c/xmlclitools> xmlgrep -gf test.xml 0 c
<c>C1<b>B3</b></c>

Look for node "b" with property "u" with value "kalle".
jensl:~/c/xmlclitools> xmlgrep -f test.xml 2 top.a.b:u=kalle
<b u="kalle">B1</b>

Same as above, but anywhere in tree.
jensl:~/c/xmlclitools> xmlgrep -gf test.xml 0 b:u=kalle
<b u="kalle">B1</b>

Look for node "b" with property "u" where value is NOT "kalle".
jensl:~/c/xmlclitools> ./xmlgrep -gf test.xml 0 b:u!=kalle
<b>B2</b>
<b>B3</b>

Node named multi with properties u=groda and id=150.
jensl:~/c/xmlclitools> ./xmlgrep -gf test.xml 0 multi:u=groda:id=150
<multi u="groda" id="150"/>

Node named multi where u is not "groda" and id is 150.
jensl:~/c/xmlclitools> ./xmlgrep -gf test.xml 0 multi:u!=groda:id=150
<multi u="kalle" id="150"/>

Print only children of matched node "item".
jensl:~/c/xmlclitools> ./xmlgrep -gcf test.xml 0 item
text<b>bold</b>text
text2<b>bold2</b>text2

Above without -c flag.
jensl:~/c/xmlclitools> ./xmlgrep -gf test.xml 0 item
<item>text<b>bold</b>text</item>
<item>text2<b>bold2</b>text2</item>

Formating
---------
Above with formating.
jensl:~/c/xmlclitools> xmlgrep -gf test.xml 0 b:u=kalle|xmlfmt b:u
kalle

With text contained by node.
jensl:~/c/xmlclitools> xmlgrep -gf test.xml 0 b:u=kalle|xmlfmt b:u @b
kalle B1

With some labels.
jensl:~/c/xmlclitools> xmlgrep -gf test.xml 0 b:u=kalle|xmlfmt "{U-value: [}{]}b:u" @b
U-value: [kalle] B1

Modifying
---------

Changing "kalle" to "sven".
> xmlmod -f test.xml2 top.a.b:u/kalle/sven

Adding new node.
> xmlmod -f test.xml2 top.a.+b:u/gunnar


Modifying textnodes
-------------------

Assign a new value (to an existing textnode).
> cat t.xml|./xmlmod test.out.@//hello

Assign (and create if needed) to a nextnode.
> cat t.xml|./xmlmod test.out.+@//hello

Match and assign.
> cat t.xml|./xmlmod test.out.@/apa/hello

Match and assign. If non-match value is appended, otherwise replaced.
> cat t.xml|./xmlmod test.out.+@/apan/hello

Append text.
> cat t.xml|./xmlmod test.out.+@/extratext
