i want to get the vaule of type in root element. if i try with getAttributeValue(“type”) it returns null value here the sample xml and code. i’m using org.jdom2.Element for parsing help will be appriciated. Sample xml my code Answer Perhaps you have bad imports. Your code works for me.