@Test
public void testFind() {

	XMLQuery q = new XMLQuery(
			"<r><a><inner>1</inner><inner>2</inner></a><b v=\"v1\"/><c v=\"v2\">i</c><d><inner>3</inner></d></r>");
	assertEquals(
			"<r><a><inner>1</inner><inner>2</inner></a><b v=\"v1\"/><c v=\"v2\">i</c><d><inner>3</inner></d></r>",
			q.clone().find("//r").toXML());
	assertEquals(
			"<r><a><inner>1</inner><inner>2</inner></a><b v=\"v1\"/><c v=\"v2\">i</c><d><inner>3</inner></d></r>",
			q.clone().find("./r").toXML());
	assertEquals(
			"<r><a><inner>1</inner><inner>2</inner></a><b v=\"v1\"/><c v=\"v2\">i</c><d><inner>3</inner></d></r>",
			q.clone().find("r").toXML());
	assertEquals(
			"<r><a><inner>1</inner><inner>2</inner></a><b v=\"v1\"/><c v=\"v2\">i</c><d><inner>3</inner></d></r>",
			q.clone().find("/r").toXML());
	assertEquals("<a><inner>1</inner><inner>2</inner></a>", q.clone().find("//a").toXML());
	assertEquals("<inner>1</inner><inner>2</inner><inner>3</inner>", q.clone().find("//inner").toXML());
	assertEquals("<inner>2</inner>", q.clone().find("//inner[2]").toXML());
	assertEquals("<inner>1</inner><inner>2</inner>", q.clone().find("//a/inner").toXML());
	assertEquals("<inner>1</inner><inner>2</inner>", q.clone().find("//a").find("./inner").toXML());
	assertEquals("<inner>1</inner><inner>2</inner>", q.clone().find("//a").find(".//inner").toXML());
	assertEquals("<inner>1</inner><inner>2</inner><inner>3</inner>", q.clone().find("//r").find(".//inner").toXML());
	assertEquals("<b v=\"v1\"/><c v=\"v2\">i</c>", q.clone().find("//*[@v]").toXML());
	assertEquals("[v=\"v1\", v=\"v2\"]", q.clone().find("//*/@v").toString());
	assertEquals("", q.clone().find("//*/@v").find("./a").toXML());
	assertEquals("<b v=\"v1\"/>", q.clone().find("//b").find(".").toXML());
	assertEquals("[v=\"v1\"]", q.clone().find("//b").find("./@*").toString());
	assertEquals("[v=\"v1\"]", q.clone().find("//b").find("@*").toString());
}