... if rootNode.ChildNodes[i].ChildNodes[J].HasAttribute('offset') then s := rootNode.ChildNodes[i].ChildNodes[J].Attributes['offset']; ...