Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for an application that will extract all XML tags contained within a specific XML file. For example I would get a list: <XML_TAG_ONE>,<XML_TAG_TWO> etc...

share|improve this question
up vote 2 down vote accepted


  <foo.xml xml2 | cut -d= -f1 | sort -u


  <foo.xml xml2 | cut -d= -f1 | sort -u | 2xml


omit the sort -u if you are interested in repetitions & duplicates.

If you don't want to see attributes

  <foo.xml xml2 | grep -v @ | cut -d= -f1 | sort -u | 2xml

If you want to use xml2 on Windows you'll probably need Cygwin or unxutils or gnuwin32 etc.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.