public static void main(String[] args) throws ParsingException, IOException, XMLStreamException
	{
		if(args.length == 0 || args.length > 3)
		{
			System.err.println("Incorrect number of arguments");
			printHelp();
			System.exit(1);
		}
		
		boolean compressed = false;
		String fileName = null;
		
		for(String arg : args)
		{
			if(arg.equals("-h"))
			{
				printHelp();
				System.exit(0);
			} else if(arg.equals("-c"))
			{
				compressed = true;
			} else
			{
				if(fileName == null)
				{
					fileName = arg;
				}
				else
				{
					System.err.println("Bad argument");
					printHelp();
					System.exit(1);
				}
			}
		}
		
		if(fileName == null)
		{
			System.err.println("No file name given");
			printHelp();
			System.exit(1);
		}
						
		InputStream in = new FileInputStream(fileName);
		
		if(compressed)
		{
			in = new GZIPInputStream(in);
		}
		
		XMLInputFactory factory = XMLInputFactory.newInstance();
		XMLEventReader eventReader = factory.createXMLEventReader(in);

		XMLParserStAX parser = new XMLParserStAX(eventReader);
		
		XMLIterator itr = new XMLIterator(parser);
		
		//Parse using iterator
		while(itr.hasNext())
			printElement(itr.next());
		
		//Parse using loop
		//parseSiblings(parser);
	}