@Test
	public void testStructure01() throws ParsingException, FileNotFoundException, XMLStreamException, TypeConversionException
	{
		setUp("/test01.xml");
		
		assertTrue(parser.getElement() == null);

		Element e = parser.next();
		assertEquals("level0", e.getName().getLocalPart());
		assertTrue(e.hasAttribute(new QName("a")));
		assertTrue(e.hasAttribute(new QName("b")));
		assertFalse(e.hasAttribute(new QName("c")));
		assertEquals("1", e.getAttribute(new QName("a")));
		assertEquals("2.3", e.getAttribute(new QName("b")));
		assertEquals(null, e.getAttribute(new QName("c")));
		
		assertEquals(Integer.valueOf(1), e.getAttribute(new QName("a"), TypeConverter.StringToInt));
		assertEquals(Double.valueOf(2.3), e.getAttribute(new QName("b"), TypeConverter.StringToDouble));
		assertEquals(null, e.getAttribute(new QName("c"), TypeConverter.StringToInt));
		
		try
		{
			e.getAttribute(new QName("b"), TypeConverter.StringToInt);
					fail("Should throw exception");
		} catch(TypeConversionException exception)	{}
		
		assertTrue(e.equals(parser.getElement()));
		assertTrue(e.hasChildren());
		
		Map<QName, String> attributes = e.getAllAttributes();
		assertEquals("1", attributes.get(new QName("a")));
		assertEquals("2.3", attributes.get(new QName("b")));
		assertEquals(2, attributes.size());
		
		Map<QName, Double> attributes_double = e.getAllAttributes(TypeConverter.StringToDouble);
		assertEquals(Double.valueOf(1.0), attributes_double.get(new QName("a")));
		assertEquals(Double.valueOf(2.3), attributes_double.get(new QName("b")));
		
		assertFalse(e.isText());
		assertEquals(null, e.getText());
		
		int level = parser.down();
		assertEquals(1, level);
		assertEquals(null, parser.getElement());

		e = parser.next();
		assertEquals("level1_1", e.getName().getLocalPart());
		assertFalse(e.hasChildren());

		e = parser.next();
		assertEquals("level1_2", e.getName().getLocalPart());
		assertEquals("a", e.getAttribute(new QName("a")));
		assertFalse(e.hasChildren());

		e = parser.next();
		assertEquals("level1_text", e.getName().getLocalPart());
		assertTrue(e.hasChildren());
		
		level = parser.down();
		assertEquals(2,level);
		
		e = parser.next();
		assertEquals(null, e.getName());
		assertFalse(e.hasChildren());
		assertEquals("some text", e.getText());
		
		level = parser.up();
		assertEquals(1, level);
		assertEquals("level1_text", parser.getElement().getName().getLocalPart());
		
		e = parser.next();
		assertEquals("level1_3", e.getName().getLocalPart());
		assertTrue(e.hasChildren());

		level = parser.down();
		assertEquals(2, level);

		e = parser.next();
		assertEquals("level2_1", e.getName().getLocalPart());
		assertFalse(e.hasChildren());
		
		e = parser.next();
		assertEquals("level2_2", e.getName().getLocalPart());
		assertTrue(e.hasChildren());

		level = parser.down();
		assertEquals(3, level);

		e = parser.next();
		assertEquals("level3_1", e.getName().getLocalPart());
		assertFalse(e.hasChildren());

		e = parser.next();
		assertEquals("level3_2", e.getName().getLocalPart());
		assertFalse(e.hasChildren());
		
		try
		{
			level = parser.down();
			fail("Should throw exception");
		} catch(InvalidParseCommandException exception)	{}
		
		assertEquals(3, level);
		assertEquals("level3_2", parser.getElement().getName().getLocalPart());

		assertEquals(null, parser.next());
		assertEquals(null, parser.getElement());

		level = parser.up();
		assertEquals(2, level);
		assertEquals("level2_2", parser.getElement().getName().getLocalPart());
		
		e = parser.next();
		assertEquals("level2_3", e.getName().getLocalPart());

		level = parser.up();
		assertEquals(1, level);
		assertEquals("level1_3", parser.getElement().getName().getLocalPart());

		e = parser.next();
		assertEquals("level1_copy", e.getName().getLocalPart());
		assertFalse(e.hasChildren());

		e = parser.next();
		assertEquals("level1_copy", e.getName().getLocalPart());
		assertFalse(e.hasChildren());
		
		level = parser.up();
		assertEquals("level0", parser.getElement().getName().getLocalPart());
		
		assertEquals(null, parser.next());
		assertEquals(null, parser.getElement());
		
		assertEquals(null, parser.next());
		assertEquals(null, parser.getElement());
	}